I personally like a .22 for home defense. I prefer not to kill if I don't have to, and, while it certainly can be lethal, it is less likely to kill than a lot of other options. It will, however, make an invader think twice about whether they ought to be in my house.
I have seen arguments that a .22 will not stop someone with one shot, that it has no real stopping power, and that trained personel will keep coming unless you hit them with someone bigger. Most likely, though, the guy breaking in is a small time thief just looking to make a quick buck, not a trained pro. As soon as ANY resistance is encountered, he is likely to try to get out, and I am happy to let him. And if he does so with one of my .22 rounds in his arse, it will be that much easier for the cops to find him afterward.
As far as how many rounds - how ever many it takes to either make him leave or drop him.