If you sell
Defer the money into a retirement account. Many retirement accounts are tax-exempt, which means you don't pay taxes until you withdraw it after you retire.
If the account is tax-deferred, you still pay taxes eventually, but it won't be as much as you would have paid initially. Be aware some accounts have limits on the amount of money you can deposit.
Health Savings Account
Another option is to deposit the money in a health savings account, which as the name says, helps you save money for future health expenses. The money isn't taxed if you withdraw it for health purposes.
You must meet certain conditions. You can't be on Medicare or be listed as a dependent on another person's tax return. You must also have a health plan with a high deductible that qualifies.
The Primary Residence Exclusion
You may be eligible for the primary residence exemption under the Taxpayer Relief Act of 1997. This code allows you to defer up to $250,000 of capital gain sales on a primary residence for single persons. The limit is $500,000 for married couples.
Plan a sale date five years from now. Live in the residence for two years out of the next five years before the sale date. After year two, convert it back into rental property, which you could still claim as a primary residence.
You aren't required to live in the home at the time of the sale. However, if you are married, you must show tax returns filed jointly. If your spouse dies before that time, you still quality for the $500,000 exemption, provided you sale the home within two years after the death date, and neither of you excluded capital gains on another home.
Look for a buyer willing to take part in a 1031 exchange and a reputable Qualified Intermediary to help with the exchange. Attempt to find a replacement property worth as much or more than the rental property, since the IRS makes investing all of your sale proceeds and having a mortgage on the replacement a requirement. The property has to be for business purposes.
List three properties and submit them to the QI realtors within forty-five days after the closing of the original residence. It is ideal to have backup property in case one sells. Choose a property, and close no later than 180 days after the original property closes. Do a cash-out refinance.