If the guy is in your house, and you're in a position to shoot him, you have not prevented the problem. The problem has already happened.
If they still continue to break in after seeing you are armed with a firearm, you can just simply just shoot them once they get inside as your life was in danger and you also solve that from ever happening again from that person.
And before you say deterrence doesn't work, just put a sign outside proudly proclaiming your residence to be a gun free zone. Go for it!
If I put that sign in front of my house, nothing would happen. The implication that somehow I would suddenly be robbed left and right I don’t think holds that much water to begin with but especially doesn’t make sense in many places people live, like a small town like mine. Just going to confuse the neighbors.