I am not a CPA. This is not professional advice from a CPA.
You should consult with a CPA. You need to know how the gain is calculated. You may not have any gain, or the amount of gain and tax may not be worth worrying about..
There are ways to avoid paying capital gains, one of them being the aforementionedTax Deferred Exchange IRS Code 1031. Again, discuss with a CPA that has experience conducting 1031 exchanges. The law is always changing, so get the latest information.
My experience is that not all CPAs have EXPERIENCE with investment property. I would also recommend talking with at least one Realtor who has experience with investment property. They might be able to refer you to some professionals for competent advice.
My experience has been that it is well worth the time, money, and effort to get as much good advice as you can, then move ahead.
Additionally, you can defer your tax with a 1031 exchange. Please consult a professional Realtor for help with this. And, I suggest that the Realtor and your tax consultant work as a team for you in this matter.
To be eligible for an exclusion, your home must have been owned by you and used as your main home for a period of at least two years out of the five years prior to its sale or exchange. The required two years of ownership and use during the fiveâ€“year period ending on the date of sale do not have to be continuous. You can meet the ownership and the use tests during different two year periods. However, both tests must be met during the fiveâ€“year period ending on the date of the sale or exchange.