If that four years was not in the past 5, which it seems is the case, then you are not able to get any of the exclusion for selling a primary home.
When you sell this you will be subject to both capital gains and recapture of excess depreciation, if any. depending on how this was depreciated your deprecation will be taxed as regular income, capital gains, or as recapture taxed at 25%.
You can not avoid capital gains tax. However you can defer it by doing what is called a 1031 or like kind exchange.
Generally (primarily) you have six months to complete the exchange after you close on the sale of the property. You have to designate the exchange before closing, and you have to use an exchange agent.
Thank you for getting back to me. I understand. When I work late at night I start getting huge spelling errors.
If you were not allowed the passive losses during the time you held the property, you are allowed to take them in the year of sale.
You are correct if you already sold this property, you have lost the opportunity for a 1031 exchange.