The opposite of Castle Doctrine is "Duty to Retreat" A simple example would be a person walking down a street at night who is confronted by an assailant. Legaly, the victim must try to escape or "retreat" before resorting to lethal force. But if retreat is impossible, then the person is justified in using lethal force.
Castle Doctrine originaly only applied to a persons home. However, in modern times it has been applied in different laws to mean a persons property, not just inside the home. A pesons car is also defined as a part of the home. Thus a carjacking victim is justified in shooting their assailant. Some states apply a persons place of employment to fall under Castle Doctrine.
Castle Doctrine also makes it next to impossible for an assailant (Or their family) to sue their victim after the fact.