“i somehow doubt that killing somebody for trying to steal something that is illegal, is legal.”
Usually not legal to kill for stealing something legal either. His defense will be two masked men attempting an armed robbery. His right to defense is even finer inside his home, with his 9 year old home with him.
Just because you are doing something illegal in your house, doesn’t mean you no longer have a right to defend yourself from violence.