This paper develops a two sided matching model of premarital cohabitation and marriage in which premarital cohabitation serves as a period of learning. We solve for the optimal policy to be followed by individuals by treating the model as a three stage dynamic programming problem. We find that couples are more discriminating when forming marital unions than when forming cohabiting unions. Cohabitation unions arise among members of the same “class” and there is overlap between the classes formed by marital unions and cohabiting unions. This implies that some cohabiting unions progress to marriage while others do not, a finding borne out by empirical studies.