Per current federal tax law, the owner has to have occupied the property for 2 of the last 5 years to qualify, and not have used the exemption on another property within 2 years of the sale date. Check to confirm that also applies to your state taxes.
Identify all capital improvements you've made to reduce the capital gains if your gain is over the exemption amount. - renovations and additions, such as a deck, new roof, new windows/doors/siding, carpeting, pool, etc.
For 2015 federal tax, see: https://www.irs.gov/pub/irs-pdf/p523.pdf
To be sure you have the most up-to-date information related to Pub. 523, such as legislation enacted after it was published, go to www.irs.gov/pub523