Understand castle domain first, and that all three of these conditions need to be met before such will cover you.
# Colorado "...any occupant of a dwelling is justified in using any degree of physical force, including deadly physical force, against another person when that other person has made an unlawful entry into the dwelling,
and when the occupant has a reasonable belief that such other person has committed a crime in the dwelling in addition to the uninvited entry, or is committing or intends to commit a crime against a person or property in addition to the uninvited entry,
and when the occupant reasonably believes that such other person might use any physical force, no matter how slight, against any occupant." 18-1-704.5 Use of deadly physical force against an intruder.
So no, you do not need to be a resident of the state, since the law covers anyone one in the state, regardless of there residency (read even covers you in a hotel if you are just passing through).