I purchased and moved into a house in December 2005. In April 2010, I was unemployed and moved several hundred miles away for a job, at which time I rented out the house. I just moved back into the house in February 2019. I would like to sell the house. Am I eligible for a partial or total exemption of the capital gains tax? Is there any benefit to me staying in the house for 2 years, or more?
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.