Theoretical question: Did the good guy do anything wrong here? How should you respond to someone who you think is a bad guy on the other side of your front door... with a pistol in hand, a rifle in hand, or a shotgun in hand? I think I favor the shotgun. Should you approach the door, or should you stand back and take up a firing position and wait for him to force his way in? Just asking.
and had legal weapons in his apartment.
...what would qualify as illegal weapons? With the right paperwork you can own anything.
Every situation is different, and has to be evaluated on its own. However, I tend to favor having a pistol in hand for those late at night situations. For a home defense long gun, I like the AR type platform with a 30 round magazine and frangible bullets that tend to penetrate less walls than buckshot.
In this case the fact that the “girlfriend” knew the attacker is very suspicious.
I think opening the door was wrong.
When the perp starts breaking down the door you probably have justifiable cause for opening fire.
Of course, he was being flanked at the time and dealing with one of them prevented the second from attacking.