Get your taxes done using TurboTax

If you use it as your Main Home for at least 2 years (until February 2021), you will qualify for a partial exclusion.  If you don't use it as your Main Home for 2 years, you don't qualify for any exclusion.

It is prorated because the rental time before the last time you used it as a Main Home can not be excluded.  So if you own it for exactly 16 years and it was rented for exactly 9 years (the actual calculation uses days), you can't exclude 9/16ths of the profit.  The other 7/16ths can be excluded (except for depreciation).

For example, let's say you bought the house for $200,000, took $50,000 of depreciation, and sold it for $300,000.  In that scenario, you would pay long-term capital gains tax on 9/16ths of the $100,000 profit ($56,250), plus pay tax on the $50,000 of depreciation.