This happens every day in America. So we have to have a plan to counteract it.
Usually to people in the illegal drug trade or people involved in bad domestic disputes. Not being involved in those activities, including allowing people who are involved in those activities into your home, even if they are related to you reduces your odds of being the victim of a home invasion to next to nothing.
If you're worried about what weapon to go for first you're likely already dead or or unconscious. Weapons play a very small part part in defense against a home invasion.
This is what we used to call "Priority of work" when moving into a new position in the Infantry modified for defending your home:
1. Don't do illegal drugs or hang around with people who do, including relatives, never let them into your home. Do your best not to involve yourself romantically with someone mentally unstable or who has family, especially former lovers or partners who are mentally unstable.
2. Harden your home. There are all kinds of threads here and other places online on the best ways to do that.
3. Have a plan on how the family will react to a home invasion. Rehearse the plan until everyone in the family knows it by heart.
4. Never open the door to anyone you can't identify as someone with legitimate business.
5. Arm yourself with whatever firearm you are most proficient with. Lock yourself and family in the safe room (you've already rehearsed this in step 3) and wait for the Calvary to arrive. Engage if the safe room is breached.
All of these steps are specific to you and your particular situation.