Investors & landlords

Yes.  Well, sort of.  The exclusion is prorated.

The rental period after 2008 can not be excluded.  The depreciation (after May 6th, 1997) also can not be excluded.  It is best explained by example (for simplicity, I'm going to use years, but the actual calculation uses days).

Let's say you owed the property for for a total of 22 years, and 9 of those years were rental years after 2008 (2009-2017).  You can't exclude those 9 years, but you can exclude the other 13 years.  So you can exclude 13/22nds of the non-depreciated gain (59.1%).

Now let's say you paid $100,000 for the home (including any improvements), claimed $60,000 of depreciation, and sold it for $300,000.  The $60,000 of depreciation can not be excluded.  That is taxed at your regular tax bracket, up to 25%.

For the other $200,000 gain, you can exclude 13/22nds (59.1%) of that gain, or $118,200.  The other $81,800 would be taxed at the long-term capital gain rates.  That is usually 15%, but the 'extra' income could possibly affect several other things on your tax return, so the net effect could be noticeably more than that.