Do not confuse 2A issues--which pertain to the right to keep and bear arms--with laws concerning the use of force.
"Castle doctrine" laws come into play whetter a resident kills or injures a criminal intruder with a firearm, a kitchen knife, a nine iron, or, as in the case of a famous home invasion case in Massachusetts, a gum ball machine.
When the framers of the Constitution drafted the Bill of Rights, a man's home was his castle, but the duty to retreat in the out of doors, when retreat was safely possible, existed in all of the first thirteen states.