The basic principle is that someone who is in his or own house is given certain presumptions regarding the justification of the use of force against an unlawful intruder that would not apply somewhere else.
As in the case of the duty to retreat and the right to not retreat (to "stand your ground"), castle doctrine provisions are variously defined in state codes and in appellate court rulings (legal precedent). One should never rely on a layman's reading of the code, or on any one statute taken out of context.
Provisions vary from one jurisdiction to another. In general, however, "castle doctrine" laws and rulings do the following:
They provide a resident or his or her guest with a presumption that an unlawful entry by an intruder gives the occupant reason to believe that deadly force is immediately necessary to defend against an imminent threat of death or serious bodily harm; that belief is one of the fundamental requirements of a defense of justification for the use of deadly force;
they establish clearly that, once the conditions for justification have been met, there is no duty to retreat within or from the domicile in the event of an attack by an unlawful intruder.
Castle doctrine laws DO NOT provide a resident with a carte blanche right to employ deadly force simply because someone has entered a domicile unlawfully. The aforementioned presumption is rebuttable: if the intruder does not pose a serious threat or has ceased to do so, the use of deadly force is not justified. Essentially, what the castle doctrine really does is reduce the burden on the defender to provide evidence supporting a reasonable belief that deadly force was necessary.
It must be emphasized that castle doctrine protection is not automatic. The defender will have to establish that he or she knew, or had reason to believe, that the thresholds for castle doctrine justification (for example, the fact of a forcible and unlawful entry) had been met. The physical evidence may clearly support that, or it may not.