The vile attacker may have been moving to attack but spun around to flee when he saw his victim had a gun and took a bullet in the back. The attacker invaded the victims’ home, assaulted him and his family and got what he deserved. Castle doctrine – not guilty.
got what he deserved
Deserved has nothing to do with it. Deadly force is justified to prevent an imminent threat. It's all about what a reasonable person would judge that the perpetrator is about to do, not what he had done.
That the perp has engaged in a home invasion and an assault has relevance only in coloring perceptions of what he is likely to do.
Would a reasonable person judge that someone who has invaded a home and committed assault upon a person is likely to commit a homicide or inflict a grave injury?
The answer is clearly yes, so lethal force is justified.
But that's a judgement of what he is likely to do, not a response to what he's already done.
The core question is always: does he pose an imminent threat of death or serious injury?
It is never: what has he done?