If an illegal were trespassing on my property, I would consider that a threat to my safety.
Well if that illegal was unarmed and not in the process of breaking into your home, then you will likely be prosecuted if you kill them. Maybe take a self defense course and learn the law.