I'm a LEO with 15+ years experience and 9+ years served in the military.
My personal recommendation for a primary home defense weapon would be a 12 gauge pump shotgun with as short a barrel that is legally possible and that your comfortable with. A shotgun is very versatile, with a large selection of ammo available for various purposes, and is quite devastating in close quarters.
My personal favorite is my 14 inch barreled 12 gauge Mossberg 590A1 shotgun with ghost ring sights, a Hogue Youth stock, a Surefire 621FGA Forend Weaponlight, Blackhawk front sling adapter, Specter Gear 3-point tactical sling, and 3GunGear.com 7-Shell Side Saddle, which has a nylon side saddle with elasticized shell holders backed with velcro that affixes to a base on the shotgun receiver. This side saddle carrier allows single-hand removal and attachment so that additional side saddle carriers can be carried on tactical vests or plate carriers and your ammo source can be easily replenished. This shotgun has an overall length (OAL) of 35 inches, which is a nice compact size for manuevering inside a house or building. This is my primary HD long gun.
I also strongly believe that a light source is MANDATORY for any HD weapon so as to positively identify your potential target! Lest it be a family member, such as a teen son/daughter sneaking back into the house...that could be extremely tragic. A weapon-mounted light could also be used offensively to blind an offender, allowing you to gain the tactical advantage in a dynamic critical incident.
As previously stated, a dog is an outstanding early warning system. Also, an alarm system and good locks on your doors and windows aid in making your home/business a less attractive target of opportunity.
When considering Home Defense, the most important things to consider are:
1) having a well thought out HD plan, AND
2) training and become intimately familiar with whatever HD firearm you choose.