Nucleophilic substitution occurs when an atom or group of atoms detaches from an organic molecule and is replaced by another. If the leaving and adding happens at the same time, it is called a S2 reaction. If the leaving group breaks away from the organic molecule and forms a carbocation before substitution occurs, it is called an S1 reaction.