Buckshot won't disperse much until beyond 7 yards or so, unless you have a sawed-off (tactical) shotgun.

A smaller shot, like #4, will disperse more quickly and is much less likely to go through a wall. However, a rifle or pistol bullet will most certainly go through anything.

The presence of children and the layout of your home will of course affect the choice you make. Better to prevent people from getting inside in the first place with proper lighting and locks. If you're worried about civil unrest, then you'll more than likely know what's coming and be able to get everyone in the house together behind the gun in the first place.