California penal code
Here's pertinent info straight from the California Penal Code. 197 is good and then read 198.5.
California's Castle Doctrine is alive, well, and strong thank you very much.
-------
197. Homicide is also justifiable when committed by any person in
any of the following cases:
1. When resisting any attempt to murder any person, or to commit a
felony, or to do some great bodily injury upon any person; or,
2. When committed in defense of habitation, property, or person,
against one who manifestly intends or endeavors, by violence or
surprise, to commit a felony, or against one who manifestly intends
and endeavors, in a violent, riotous or tumultuous manner, to enter
the habitation of another for the purpose of offering violence to any
person therein; or,
3. When committed in the lawful defense of such person, or of a
wife or husband, parent, child, master, mistress, or servant of such
person, when there is reasonable ground to apprehend a design to
commit a felony or to do some great bodily injury, and imminent
danger of such design being accomplished; but such person, or the
person in whose behalf the defense was made, if he was the assailant
or engaged in mutual combat, must really and in good faith have
endeavored to decline any further struggle before the homicide was
committed; or,
4. When necessarily committed in attempting, by lawful ways and
means, to apprehend any person for any felony committed, or in
lawfully suppressing any riot, or in lawfully keeping and preserving
the peace.
198. A bare fear of the commission of any of the offenses mentioned
in subdivisions 2 and 3 of Section 197, to prevent which homicide
may be lawfully committed, is not sufficient to justify it. But the
circumstances must be sufficient to excite the fears of a reasonable
person, and the party killing must have acted under the influence of
such fears alone.
198.5. Any person using force intended or likely to cause death or
great bodily injury within his or her residence shall be presumed to
have held a reasonable fear of imminent peril of death or great
bodily injury to self, family, or a member of the household when that
force is used against another person, not a member of the family or
household, who unlawfully and forcibly enters or has unlawfully and
forcibly entered the residence and the person using the force knew or
had reason to believe that an unlawful and forcible entry occurred.
As used in this section, great bodily injury means a significant
or substantial physical injury.
199. The homicide appearing to be justifiable or excusable, the
person indicted must, upon his trial, be fully acquitted and
discharged.