As with SN1 substitution, SN2 substitution of alcohols is generally acid catalyzed, so that hydroxyl group can leave as water.
Tertiary alcohols are more likely to react with the SN1 mechanism. SN2 is the favored process for primary alcohols. In the SN2 mechanism, the nucleophile donates an electron pair from one side while the water departs with an electron pair on the other side of the carbon. Because attack of the nucleophile occurs in concert with departure of the leaving group, the SN2 mechanism always occurs with inversion of configuration. If the reagent alcohol is pure enantiomer, the product will also be a pure enantiomer, though with inverted configuration.
The "2" in SN2 substitution refers to the fact that both the nucleophile and the substrate appear in the rate determining step in the SN2 mechanism, and thus the rate expression is second order.