He puts his hand on his firearm before the thug even opens the door. Either there’s an unnatural hesitation in opening the door that he recognizes, the look of a hoodie in the outline, or that’s how he greets everyone. In any case, the outcome is justice. Attempting to rob someone on that high an alert is a very bad idea.
Note: In many jurisdictions, he might be in trouble over the last five or so shots (and certainly in the People’s Republic of Maryland), but in my view he was just making sure an armed criminal didn’t shoot back.
Glass door, perhaps he's watching the guy put his mask on prior to entry.