In general, buckshot is the way to go.
In a house, a lot depends on the construction of the exterior walls, who lives with you (children), and how close the neighbors are.
Heavy shot like 00 will penetrate any wall including exterior walls that aren't made of brick or block.
This is risky for the neighborhood.
Most ANY shot will penetrate ANY interior wall. Even light bird shot.
Some people advise using bird shot, and go on about how it "makes a big bloody hole" and "Is one solid slug at close range".
The problems are: Yes it makes a big bloody hole, but it's a big bloody SHALLOW hole. Also, shot is NOT a "solid slug".
Bird shot simply fails to reliably penetrate deeply enough to be sure of reaching vital organs.
When that "solid slug" hits it simply fragments like the small shot it is, and fails to penetrate.
Bird shot quite simply lacks enough mass to penetrate deeply enough to reliably do the job, especially if the bad guy is wearing thick clothing.
You'll hear many stories about people killed stone cold dead by bird shot, but these anecdotal stories never cover the many cases where it fails.
A "gapping bloody hole" that MAY kill "eventually" is not something you want in your bedroom at 3:00 am.
For that reason, stick with PROVEN effective ammo, and that's buckshot in #00, #1, or #4.
A good many police departments and home owners have started using the newer "Reduced Recoil" loads.
These loads reduce the amount of recoil by either reducing the shot by a few pellets or by reducing the powder load.
As example, there are reduced recoil #00 buckshot loads that either have 8 instead of 9 pellets, OR keep the 9 pellets and reduce the powder charge.
One factor to consider is that the most ballistically "perfect" buckshot is #1.
It offers more shot and tissue damage than #00, but has better penetration than the small #4.
Bottom line is: Stick with buckshot, which will end the problem NOW, with no risk of a failure.
Choose a reduced recoil round which will allow faster followup shots, and has less penetration in walls.
Choose lighter buckshot like #1 or #4.
Simply be careful if you have to shoot inside a dwelling.
There is no "magic" ammunition that will reliably stop an intruder BUT won't blow right through interior and most exterior walls.
NO rifle, pistol, or shotgun round can do both.