Two Family House gains

I live in Massachusetts and own a 2 family house which I have lived in one unit and rented the other for 25 years. I plan to convert it to condos and sell my unit and move into the now rental unit.  If I sell the rental (now primary residence) unit in 2.5 years, will I be able to then apply the $500,00 (married) capital gains exclusion to the sale.