"Castle Doctrine" differs from state to state. In California if you don't kill them inside your home you better drag the body inside or you've commited murder.
In Texas you can pursue and shoot an attacker outside your home and not be guilty of murder.
This of course assumes, as you stated, that you can prove just cause.