The key word is “fleeing”. If the robber(s) were outside when shot at then the guy is sunk. But, I suspect, the police questioned all parties and the perps said they were leaving because they heard him returning or maybe the homeowner admitted they were leaving, but, if one or both were still in the house, even with their backs to him, I think he could argue that they were merely seeking cover from him and were obviously armed themselves and he got the drop on them before they did on him.
My guess is that they weren’t “fleeing” until after the first shot..........