Someone whose mental capability is diminished would provide a number of reasons - too drunk, has alzheimers, mentally ill and hence walk into the wrong home.
This class of people tend not to break doors in, or have the physical capacity to do so. In the event of a drunk, someone who is high on drugs, or mental weirdo, if they cannot or will not respond correctly to "Stop. I have a gun and I will shoot you if you come closer!", and they've broken your door in, they are unquestionably a danger to your life, and the lives of your family members. As such, use of force up to and including deadly force is justified and legal in most jurisdictions, under many circumstances; for example, you may or not be required by local law to retreat from the threat, deadly force finally being legal when you're cornered. Deadly force doesn't necessarily mean firearm either. Baseball bats, axe handles, iron pipes, swords, knives, martial arts etc. may all be considered deadly force.
Police/fire services being given the wrong house in an emergency call as a result of accident or a prank.
If the EMT/Fire guys show up, that can all be sorted out before one shoots. I'd like to point out that anyone who is even trained basically understands the 4 rules of shooting. 1) All guns are loaded 2) don't point the gun at anything you don't want to die 3) Keep your finger off of the trigger until you are ready to shoot 4) Before you ready to shoot, identify your target and everything behind it. Hopefully if something were to happen like this, everyone can take a deep breath, shake hands and go home safely.****
However, chances are if there are law enforcement in your house uninvited, they're of the no-knock warrant ninja-commando type who have their address wrong. It's happened before, and sure enough, police are far and away more dangerous to your family than any other class of invader. God forbid you have a gun in your hand, as they like to shoot anything that moves first and ask questions later. You'd better hope your dog is asleep and deaf, because they're liable to shoot it as well. It's only a matter of time until these types of raids happen upon a PTSD riddled vet with a hair trigger, leaving a bunch of cops and one vet dead.
People being given the wrong address or similar for a party accidently or not.
Overly informal neighbour believing you would be okay with them just popping in.****
They'll sure learn quickly to have the right address, and not just pop in****. On the other hand, if a woman is raped, it's more often by someone she knows than not, so your daughters and wife aught to be weary of such an informal neighbor, especially if its male.
Landlord if you have one entering the house to check/confirm something.
Landlords knock and or call and just don't bust down the door.****
Someone entering to warn you about an imminent danger.
Will probably themselves more occupied with running away to be too bothered to knock your door down and search you out.****
Gardener/Cleaner if you have one either because they're meant to be there or they came on the wrong day accidently or intentionally or you forgot what day they were supposed to be there.
****
Footnote: ****Again, just because you have a gun in hand or on your person does not mean your only available course of action is to immediately shoot every Girl Scout or innocent passerby who knocks on your door square in the face.