Training first and foremost.
After that, it is what you feel most capable with to defend your home and family.
Shotgun is extremely flexible with diferent types of ammunition, loads, ability to keep different kinds of loads mounted to the shotgun. If you pattern your shotgun with a specific lot number of ammo at different ranges, you do not have to worry as much about tearing up your property. Also it is very effective. As far as the overall length, there are different techniques for getting around corners or to recover your weapon if it is grabbed.
The pistol is small and a lot easier than a shotgun to maneauver with for most people. Also in small rooms you can keep it in a drawer. As far as effectiveness, a double tap can increase effectiveness.
In your house, what would you rather go fight with?
Either way, I would recommend a mounted light. Clearing a house without a light is a lot less fun when you really have to do it. Either way use good ammo.