Basically never because they are ridiculously impractical for normal to carry around so they are virtually never available for anything to even think about using.
Al least once. I'd have to dig up the article, but somewhere in one of the flat states (Kansas, I think?), a group of three armed people broke into a home that a teen was home at. He confronted and shot all of the robbers with an AR-15. I believe that two died on the scene, one made it out to the getaway car and bled to death in the car. The driver of the car was charged with three counts of felony murder.
AR-15 carbines and SBRs are very, very good for home defense, far better than a shotgun (long/unwieldy, low ammunition capacity) or handgun (poor sight radius, more difficult to aim), and the small, light bullet tends to not overpenetrate (e.g., you're less likely to accidentally shoot your neighbors than you might be with a larger, heavier bullet).
I won't claim high confidence on this, but the overpenetration thing sounds wrong to me. I thought the chambering for AR-15s was naturally FMJ and piercing to some degree. Meanwhile, buckshot from a shotgun splits into many lighter projectiles that would stop at the first soft layer.
I even remember a talk from COD developers where they admitted the loud, powerful boom of a shotgun would make you think it'd go straight through walls, so they coded the game that way even though the buckshot would stop early.
Check out theboxotruth.com. They've tested all sorts of ammunition against all sorts of barriers.
Rifle bullets are relatively small, lightweight, and fast. When they impact building materials, they tend to shatter. They're dangerous on the other side of the first wall, but they'll lose a lot more energy a lot faster.
Pistol bullets, buckshot, slugs, etc are relatively large, heavy, and slow. They tend to remain intact and carry more energy through multiple walls.
A lot of law enforcement agencies switched their long guns from pistol-caliber carbines to 5.56 rifles specifically because they over penetrate less.
55gr FMJ BT--which is pretty much the most common .223 ammunition--tends to fragment pretty dramatically inside about 300y after hitting something solid. Once it hits something solid, it starts tumbling and tears itself apart pretty fast, in part because it's moving at supersonic speeds. That's part of the reason why it's so lethal at short ranges; it's turning into a lot of small fragments.. (That, and the cavitation that is produced by bullets moving >2600fps; that will produce a temporary wound cavity that exceeds the elasticity of tissue, and turns into a permanent wound cavity. The cavitation produced by subsonic bullets isn't great enough to turn into a permanent wound channel.) At subsonic speeds, it doesn't fragment, and just 'ice picks'. A shotgun with birdshot would definitely not over penetrate, but then you run the risk of not being adequately lethal on your target. Buckshot is still going to penetrate exterior walls pretty handily without being deformed significantly or fragmenting, even if a lot of the energy has been eaten up by a house's cladding; it might not kill easily, but it can still wound. But then you're back to the original problem: large/long firearm, heavy recoil, very limited ammunition in a tube magazine, and slow to reload.
You know that AR doesn't stand for assault rifle, right? The AR is for Armalite, the inventors of the design. It's just a semiautomatic rifle with a detachable magazine, it's pretty common to use as a hunting rifle.
And yeah, you see AR-15 and it's workalikes all over the place because they're flexible. Literally the most common rifle in the US. That's why they're so common in public mass shootings - those shooters generally aren't buying a gun specifically for that sort of shooting, they're using a gun they already have access to or what they can readily purchase off the shelf.
It's not the best gun for any scenario, but it's a good enough gun for most and that's because it's modular and the guns and parts are both commonly available.
To add to this - it's modular because there's a US military specification for it. As long as parts are to spec, they're interchangeable. If I wreck my barrel, any AR-15 barrel (...that uses the same length of gas system...) should bolt on to my receiver. If I break my bolt carrier, any bold carrier should work. If the length of pull on a fixed stock isn't good, I can get an adjustable stock.
'Building' an AR-15 from parts is only slightly harder and more expensive than building Star Wars Lego (tm) kits. A bod-standard milspec AR-15 that's reliable and accurate enough (3 MOA) can be had for about $450.
And, BTW, @Schadrach is absolutely right about it being a common hunting rifle. .223 Rem is commonly used for medium sized game and varmints; it's commonly used for coyotes and feral pigs, and some people (depending on your state) use it for deer with heavier, 70-odd grain bullets.
Have you ever fired a gun while under time pressure? Like, for instance, in a 3 gun competition? Or shot at someone while they're shooting at you? Misses in combat are common. Would you rather miss a lot with a firearm that only carries 7 bullets, or one that has 30?
Oh, and before you spread some fudd about shotguns pellets spreading and not needing to aim, at home defense distances--<10y--your shot pattern with no choke on a 30" barrel with 00 buckshot is going to be about 4". Firing a shotgun without it being braced on your shoulder? Good fucking luck hitting anything. And your shotgun is still going to be about half again as long-at a minimum--than a carbine.
Done a lot of skeet shooting. Agreed about comment with no shoulder stock but the imitation factor of a shotgun roar in an enclosed space is pretty potent, especially if your target holds a pistol.
Why try a shootout with someone with a fucken hand cannon? Easier targets to rob.
You telling me a 12 gauge (hell, lets make it 10 guage for fun) in a tight space like your hallway or someone coming thru your doorway is worse that an AR15?
Why did the Germans try to get the trench gun banned in WW1? Because in close quarters (like inside a house) that shit is nasty.
First off the spread on a shotgun is not like a video game where your entire view is covered in lead. It's still relatively grouped.
Second, the trench gun had a stock. The stock is important. It allows you to properly and quickly aim at what you're trying to shoot. The WW1 'Trench Gunn had a stock.
If your goal is to take down home invaders, you want a stock on your shotgun.
If you just want to put lead in your walls and furniture, go with a folding stock one.
That being said, a gun is the least useful device you can acquire to help you during a home invasion. A firearm in your home is statistically more likely to cause accidental harm to you or your family than it is going to help you fight off hole invaders.
Yes, it absolutely is. The only people suggesting that it's not are fudds. At home-invasion distances, there is no effective spread on your pellets; your shotgun pattern is a single hole. That means that, yes, you need to put that shotgun to your shoulder, and you need to aim. Given that--outside of box mag fed shotguns--you get 8 shots or less in that shotgun, you better hope that you're a really good shot when someone else is actively shooting back.
You know that the alternative in WWI was a bolt-action battle rifle, right? A pump or lever gun would have been far faster. The sturmgewehr StG-44 wasn't invented until 1943; if it had been in existence in 1914, the Germans absolutely would have been using them in trench battles over. As it was, the Bergmann MP 18--the first real submachine gun, fielded in 1918, near the end of the war--gave a significant advantage in trench combat. (But by the time it hit front line troops, there wasn't anything that could have stopped Germany from losing.)
Are they all Jason Bourne like fanatics who are willing to commit suicide in the process of killing you?
If they are, then you have done something seriously horrific and they are most likely justified in seeking your end.
...That's quite a stretch, don't you think? Bluntly, if anyone breaks into my home while I'm home, I'm going to assume that they're intent on causing harm to me, because I'm sure as shit not going to politely ask them to fill out a questionnaire before acting.