Sale of primary residence the year you got married

If a couple before to get married each own a house and designated each of them primary residence and they sell one of the residence the year that they get married, can they get the full primary residence tax gain excemption for that property? Otherwise how does it work?