The problem here is that HE opened his door and if he shot the guy as he...
was fleeing, he will likely be charged. If you ever find yourself in such a situation, immediately call 911 if possible and sit back until they actually break your door jam, THEN fire away. At that point it is a home invasion and the Castle Doctrine should protect you from prosecution.