It varies from state to state but here is what the penal code in Texas says:
Sec. 9.32. DEADLY FORCE IN DEFENSE OF PERSON. (a) A person is justified in using deadly force against another:
(1) if the actor would be justified in using force against the other under Section 9.31; and
(2) when and to the degree the actor reasonably believes the deadly force is immediately necessary:
(A) to protect the actor against the other's use or attempted use of unlawful deadly force; or
(B) to prevent the other's imminent commission of aggravated kidnapping, murder, sexual assault, aggravated sexual assault, robbery, or aggravated robbery.
(b) The actor's belief under Subsection (a)(2) that the deadly force was immediately necessary as described by that subdivision is presumed to be reasonable if the actor:
(1) knew or had reason to believe that the person against whom the deadly force was used:
(A) unlawfully and with force entered, or was attempting to enter unlawfully and with force, the actor's occupied habitation, vehicle, or place of business or employment;
(B) unlawfully and with force removed, or was attempting to remove unlawfully and with force, the actor from the actor's habitation, vehicle, or place of business or employment; or
(C) was committing or attempting to commit an offense described by Subsection (a)(2)(B);
(2) did not provoke the person against whom the force was used; and
(3) was not otherwise engaged in criminal activity, other than a Class C misdemeanor that is a violation of a law or ordinance regulating traffic at the time the force was used.
(c) A person who has a right to be present at the location where the deadly force is used, who has not provoked the person against whom the deadly force is used, and who is not engaged in criminal activity at the time the deadly force is used is not required to retreat before using deadly force as described by this section.
(d) For purposes of Subsection (a)(2), in determining whether an actor described by Subsection (c) reasonably believed that the use of deadly force was necessary, a finder of fact may not consider whether the actor failed to retreat.
Acts 1973, 63rd Leg., p. 883, ch. 399, Sec. 1, eff. Jan. 1, 1974. Amended by Acts 1983, 68th Leg., p. 5316, ch. 977, Sec. 5, eff. Sept. 1, 1983; Acts 1993, 73rd Leg., ch. 900, Sec. 1.01, eff. Sept. 1, 1994; Acts 1995, 74th Leg., ch. 235, Sec. 1, eff. Sept. 1, 1995.
Amended by:
Acts 2007, 80th Leg., R.S., Ch. 1, Sec. 3, eff. September 1, 2007.