Deductions & credits

The closing date in 2017 has to be at least 2 years plus 1 day after the closing date in 2015.  And you have to have lived in the home personally, not used it as a rental or vacation home.  But then you would qualify to exclude your gain again.