If anyone, law enforcement or otherwise, illegally, forcibly enters your home, that person should expect that they may be shot
In most cases, that's a necessary but not sufficient condition to legally shoot someone. Castle doctrine
which not all states subscribe to
just means that a homeowner has no duty to retreat from their home even in a situation where they believe that they could do so safely, can instead use deadly force against an intruder, but there are also other conditions. Usually you need to also reasonably believe that you are at threat of death or serious bodily injury. It's not, alone, a blank check to use deadly force against someone illegally entering your home.
In Texas, which has unusually permissive laws, you're allowed to use deadly force against someone engaging in burglary if you reasonably believe that you cannot otherwise protect your property without risk of death or severe injury, which is probably the closest that I'm aware of:
https://codes.findlaw.com/tx/penal-code/penal-sect-9-42/
Texas Penal Code - PENAL § 9.42. Deadly Force to Protect Property
A person is justified in using deadly force against another to protect land or tangible, movable property:
(1) if he would be justified in using force against the other under Section 9.41; and
(2) when and to the degree he reasonably believes the deadly force is immediately necessary:
(A) to prevent the other's imminent commission of arson, burglary, robbery, aggravated robbery, theft during the nighttime, or criminal mischief during the nighttime; or
(B) to prevent the other who is fleeing immediately after committing burglary, robbery, aggravated robbery, or theft during the nighttime from escaping with the property; and
(3) he reasonably believes that:
(A) the land or property cannot be protected or recovered by any other means; or
(B) the use of force other than deadly force to protect or recover the land or property would expose the actor or another to a substantial risk of death or serious bodily injury.