A castle doctrine, also known as a castle law or a defense of habitation law, is a legal doctrine that designates a person’s abode or any legally occupied place (for example, a vehicle or home) as a place in which that person has protections and immunities permitting one, in certain circumstances, to use force (up to and including deadly force) to defend oneself against an intruder, free from legal prosecution for the consequences of the force used. The term is most commonly used in the United States, though many other countries (see below) invoke comparable principles in their laws.
A person may have a duty to retreat to avoid violence if one can reasonably do so. Castle doctrines lessen the duty to retreat when an individual is assaulted within one’s own home. Deadly force may either be justified, the burdens of production and proof for charges impeded, or an affirmative defense against criminal homicide applicable, in cases “when the actor reasonably fears imminent peril of death or serious bodily harm to him or herself or another”. The castle doctrine is not a defined law that can be invoked, but a set of principles which may be incorporated in some form in many jurisdictions. Castle doctrines may not provide civil immunity, such as from wrongful death suits, which have a much lower burden of proof.
Justifiable homicide in self-defense which happens to occur inside one’s home is distinct, as a matter of law, from castle doctrine because the mere occurrence of trespassing—and occasionally a subjective requirement of fear—is sufficient to invoke the castle doctrine, the burden of proof of fact is much less challenging than that of justifying a homicide in self-defense. With justifiable homicide in self-defense, one generally must objectively prove to a trier of fact, against all reasonable doubt, the intent in the intruder’s mind to commit violence or a felony. It would be a misconception of law to infer that because a state has a justifiable homicide in self-defense provision pertaining to one’s domicile, it has a castle doctrine protecting the estate and exonerating any duty whatsoever to retreat therefrom. The doctrine can be misused as a pretext for extrajudicial punishment in private spaces. The use of this legal principle in the United States has been controversial in relation to a number of cases in which it has been invoked, including the deaths of Japanese exchange student Yoshihiro Hattori and Scottish businessman Andrew de Vries.
Read more here at Wikipedia
A stand-your-ground law (sometimes called “line in the sand” or “no duty to retreat” law) provides that people may use lethal force to defend themselves or others (right of self-defense) against threats or reasonably perceived threats, regardless of whether they can safely retreat from the situation. Under such a law, people have no duty to retreat from any place where they have a lawful right to be and may use any necessary force if they reasonably believe they are in imminent danger of death, serious bodily harm, kidnapping, rape, or (in some jurisdictions) robbery or some other serious crimes. The exact details vary by jurisdiction.
The alternative to stand-your-ground, followed by many jurisdictions, is duty to retreat, under which people may not use deadly force, even in self-defense, if they could retreat with complete safety. Even duty to retreat jurisdictions, though, generally take a stand-your-ground approach when the defender is in the defender’s own home; this is called the castle doctrine. The castle doctrine and “stand-your-ground” laws more generally provide defenses for people who have been charged with criminal homicide, attempted criminal homicide, and similar crimes.
A 2018 RAND Corporation review of existing research concluded that “there is moderate evidence that stand-your-ground laws may increase homicide rates and limited evidence that the laws increase firearm homicides in particular.” In 2019, RAND authors indicated additional evidence had appeared to reinforce their conclusions.
German law permits self-defense against an unlawful attack. If there is no other possibility for defense, it is generally allowed to use even deadly force without a duty to retreat. However, there must not be an extreme imbalance (“extremes Missverhältnis”) between the defended right and the chosen method of defense. In particular, in case firearms are used, a warning shot must be given when defending a solely material asset. If the self-defense was excessive, its perpetrator is not to be punished if they exceeded on account of confusion, fear or terror.
Read more here at Wikipedia