The exclusion
According to the IRS, if you have a capital gain from the sale of your main home, you may qualify to exclude up to $250,000 of that gain from your income, or up to $500,000 if you file a joint return with your spouse.
The ownership test
You meet it if you or your spouse owned the home for at least 24 months (2 years) out of the last 5 years leading up to the date of the sale.
The use test
You meet it if you used the home as a residence for at least 24 months (2 years) of the previous 5 years. The two tests can be met in different two-year periods, but both within the five-year period ending on the date of sale.
Using it twice
Generally you are not eligible if you excluded the gain from the sale of another home during the two years before this sale. IRS Publication 523 has the full rules and exceptions.
What the calculator does
It leaves taxes out on both paths, including tax on investment gains for the renter. If your horizon is short, compare the ownership and use tests with your own dates.