Handguns and rifles can penetrate multiple walls, including your neighbor's house. Shotguns limit it to a smaller area. As well as, going through walls. The caveat being that you hit your target and kept the pellets from going much further
Larry
Which is why you don't fire anything unless you are capable of hitting it. A shotgun however fires multiple rounds which aren't all going to hit the person. No matter what the load, 00 buck or tiny steel bird shot your going to have some BB's not hit the person and instead hit wall board, metal, etc.
Sure rifle and hang gun rounds can go through walls too, but if you intend to just spray rounds all over the place then you have no business with a gun in the first place.
I write from experience as a member of a SWAT team and as a scout sniper. Ive actually tried all these materials myself with various weapons.
The Box O' Truth - Ammo Penetration Testing