(iStock)

My husband and I live in southern California in our own home, and we also have two rental homes out of state. We are contemplating a move after retirement to one of those out-of-state homes. We’d live in the home for two years, fix the home up and then sell it. We’d avoid capital gains tax when selling.

Can we also avoid paying taxes on recapture with this plan? We have owned the rentals for more than 10 years, claiming depreciation (and often other losses) each year.

Your plan sounds like it would be too good to be true — and it is. What you are trying to do is sell your California home and pay no federal income taxes on the sale of the home. You then want to move to one of your rental homes, live there for two years, then sell that home and not pay federal income taxes. We assume that you’d end up in the last rental home and stay there.

On the sale of your current home, the IRS would allow you to exclude from federal income taxes up to $500,000 of gains (profits) on the sale of your home. Among some of the other rules you must have abided by is that the home must have been your primary residence and it must have been your primary residence for two out of the last five years. Those are the big rules, and there are some small-print items as well, but for practical purposes, if you sell the home and your profit is less than $500,000 you shouldn’t have to pay any taxes to the IRS. (Keep in mind if you were single, you would get only a $250,000 exclusion.)

So far, so good. Now when you move to the rental property, the IRS closed a loophole some time ago that allowed people to treat the rental property as a primary residence on sale and not have to pay taxes on the profit as if it was their primary home for all time.

Now the IRS will divide the time you’ve owned the home into two parts: When it was your primary residence and when it was a rental property. So you’d have to compute the time you lived in the home and the time it was rented as separate periods of time, and the IRS would expect to get some of the money from the profit for the time the home was a rental and exclude some of the gain for the time the home was a personal residence.

Again, there are finer points that come into play, but in a nutshell, you would have the opportunity to not pay taxes on some of the appreciation. If you owned the home for a total of 12 years and the home was a rental home for 10 of those years and a primary residence for two, then in fractional terms, the property was 5/6 a rental property and 1/6 a primary residence. You will also be responsible for the repayment of any depreciation you took on the property for the 10 years that you received the depreciation tax benefit on your tax returns.

Due to some timing requirements as to when the government changed the rules, you might be able to get a better treatment for the time you can consider the home to be a primary residence and less time that it would be considered a rental. You’ll need to go over the timing, dates and other fine details with a tax preparer who has a good grasp of the Internal Revenue Code Section 121 — the section that deals with this issues and other home sale issues.

Again, our example is designed to give you an idea of where you could end up; not to provide specific details for your transaction. The date you bought, rented and ultimately moved into your rental property will be important, as will be your records for the upgrade and maintenance of the property when it was rented.

As you can see, the calculations may get complicated, particularly when you start to take into account capital improvements you may have made to the property while you rented the home or once it becomes your primary residence. Your best bet is to hire a good person with knowledge of these issues, and set up different scenarios for your project and see whether it will be worth your while to move to the home and improve it significantly.

Ilyce Glink is the creator of an 18-part webinar+ebook series called “The Intentional Investor: How to Be Wildly Successful in Real Estate” as well as the author of many books on real estate. She also hosts the “Real Estate Minute” on her YouTube channel. Samuel J. Tamkin is a Chicago-based real estate attorney. Contact them at ThinkGlink.com.