Depends on where you live.
Really since we all live in different places governed by a completely different set of rules.
In order to convince a jury that you had no other choice of taking a life is that the perp had opportunity, ability and your life was in jeopardy. Without all 3 it's homicide unless you live in a shoot first state that recognizes the castle doctrine.
So to cover my own ass I'm covering and challenging. Until that door breaches whereas the perp has opportunity and most likely ability I'm not doing anything but calling 911. I've got the opportunity in this situation - he doesn't know what the inside of my room looks like, he doesn't know how many are in the room and unfortunately for him there are 2 of us with firearms that certainly know how to use them and have pre-determined a plan for this type of situation.
Best case scenario the person runs away. Worst case scenario he kicks open my door and gets a slug in the chest. Either way I've won.