This is specifically about Colorado (US), but I'll take an answer for other US states with similar laws.
I know that the castle doctrine says that I can protect my "castle", that is to say, my home. So if an intruder breaks into my house, I have the right to shoot them. I read the relevant 'stand your ground' law (CRS 18-1-704.5) and it's pretty clear that the right extends to any occupant against "another person when that other person has made an unlawful entry into the dwelling." - subsection (2)
The hypothetical situation is this: Alice is woken up by a noise in the middle of the night. She looks out the windows and sees Bob trespassing in her backyard. Bob has with him a red gasoline can and a lighter. He is in the process of pouring the gasoline against the side of Alice's house. Alice comes to the conclusion that Bob is attempting to burn her house down, with her and her family in it. Alice gets her gun and shoots Bob from her bedroom window.
Is Alice immune from prosecution for her use of deadly force due to Colorado's stand your ground rules?
Since Bob had not "made an unlawful entry into the dwelling", it seems like CRS 18-1-704.5 should not apply. He has trespassed in the yard, but not the house; the house is the dwelling, the yard is not. So while Alice may have been in fear for her life (and that of her family), she is not necessarily immune to prosecution for her use of deadly force based on this law.
However, subsection (1) of this law says: "The general assembly hereby recognizes that the citizens of Colorado have a right to expect absolute safety within their own homes." If Bob had succeeded in setting the house on fire, Alice's "right to ... absolute safety" would have been violated. So it seems like the legislators' intent was that Alice has the right to protect her house, to preserve her safety within it, and therefore it should apply to the situation where the other party's actions are directly threatening it.
Can someone shed light on this scenario? Does my right to protect my "castle" only extend to people who break into it, and not people who are attacking it directly from outside?