UR is correct, the laws did change. A portion of your gain will be tax-free, but a prorated portion will be taxable, depending on the period used as a rental.
The portion of the profit that’s subject to tax is based on the ratio of the time after 31 December 2008 when the house was a second home or a rental unit, to the total time you owned it.
Also, it may have to be your primary residence when you sell it (e.g. you move back in).
Take UR’s recommendation. Consult a tax advisor, but don;t take their word for it. Research it yourself also. But there’s lots of stale info on the web that does not account for recent tax law changes. Confirm any advice with IRS publications.