IRS Says “Not So Fast” On 2 out of 5 Primary Residence Rule | USTaxAid

Diane Kennedy's Blog

IRS Says “Not So Fast” On 2 out of 5 Primary Residence Rule

Written by Diane Kennedy, CPA on May 2, 2018

One of the most misunderstood parts of real estate tax is the capital gains exclusion for primary residences that you have lived in for 2 out of the previous 5 years. It used to be just that simple. If you lived in a property 2 out of the past 5 years, you got to take either $250,000 of capital gains tax free (single) or $500,000 of capital gains tax free (married, filing jointly).

Quietly, the IRS has been changing the rules. Or maybe not so quietly, it’s just that there has been so much other news that than it’s been easy to have missed some of the changes.

There are three major changes. In today’s blog, I’m going to talk about what happens if you move into your former rental property.

First of all, you do not get to move into a former rental property and automatically get all the gains tax free as long as you’re under the capital gains exclusion amount.

The first change, which I think is a little better known is that you have to pay tax on the recaptured accumulated depreciation. So even if you normally would have had capital gains exclusion to cover all the gain, you still have to pay tax on the previous depreciation that you have taken on the property.

The second change has to do with the fact that it was rented before. You have to calculate the total gain first and then determine how much is applicable to the period that it was rented out past 2009 and how much was applicable to the years you lived in it.

Let’s say that you owned a property for 6 years. For the first 4 years you rented the property out. You then lived in the home as your primary residence for the next 2 years. You had a total of $150,000 of capital gains over the 6 year period.

However, you lived in the home for 2 out of 6 years since 2009, so only 1/3 (2 divided by 6) of the capital gains will be considered qualifying use. That means you have a capital gains exclusion of $50,000 (1/3 of $150,000). Of course, there is depreciation which also must be recaptured.

And, of course, there are some strategies you can use to maximize the capital gains exclusion. That’s just one little aspect of tax that has changed. Make sure you pick up your copy of “FIRST LOOK! Taxmageddon 2018” when it releases with a soft opening here on


  1. Ken says:

    My wife and I
    1. Bought our only house in 1987 and lived there until 1994 and rented it until 2013.
    2. Sold the first house and bought another house through a 1031 exchange in 2013.
    3. Plan to sell it and buy a similar house through a 1031 exchange again in Q1 this year.
    4. Plan to rent it for two years and then live there many years as our primary residence but live there at least three years.

    Can we (joint filing) get the maximum exclusion if we sell the house in the step (3) above after five years?

  2. Diane Kennedy says:

    Great question, Ken. It brings up 3 different important law changes that people often forget and is too much to cover in a response here.

    I’m going to write a blog about it to post sometime from 1/22/21 – 1/24/21.

  3. Daine says:

    If you sell a home and still have a mortgage, say 60K left on your mortgage. Please confirm if my capital gains tax will only be based on the profit I’ve made from selling the house (i.e., after I’ve deducted the 60K still owed on the mortgage of the home.) I’ve lived in the house now worth 400K during the entire period of the mortgage for over 5 years.

    Also, how would this rule work on a duplex property you have a mortgage on if you’re living in one unit A and renting out unit B?

    Thank you in advance.

  4. Diane Kennedy says:

    Hi Daine:

    Your gain is calculated as the sales price minus your sales costs, minus you basis and minus improvements.

    So if it’s now worth $400,000, we would subtract the cost of sales, such as commissions and seller fees. Then we subtract the basis. Let’s say your cost of sales are $30,000 and your basis in the home (what you paid plus improvements) is $200,000.

    Your gain would be calculated as $400K – $30K – $200K.

    The amount of your loan doesn’t figure into the calculation for gain at all.

    I’ll answer the duplex question in a separate note.

  5. Diane Kennedy says:


    Question #2 from your post. What if you sell a duplex?

    In the case of a duplex (2 family home) you will need to divide up the basis and sales price. You end up with two separate calculations.

    Presumably, you’ve been depreciating the rented portion of the duplex, so you already have that basis.

    Then for the sales price, you need to divide the selling price. If the two units are absolutely the same, just divide it in two. If your home unit was fixed up more with a higher grade of materials, you may actually allocate more sales price to your own home.

    Let’s say the total sales price is $500,000 and they are exactly the same. Sales price is $250,000/ea. The basis was $200,000 again split exactly the same. There is also accumulated depreciation of $25,000 on the rental side. That has to be added back in the gain calculation.

    Cost of sales is $30,000 in total.

    So home gain is: $250,000 – $100,000-15,000 = $135,000 Rental gain is $250,000 – $100,000-15,000 +25,000 = $160,000.

  6. Charles Murray says:

    How does the IRS know for sure if you have lived 6 mo,, 1 dayi
    for at least 2 years out of the last 5 to avoid the capital gains tax? I assume they don’t do a bed check every night.

  7. Diane Kennedy says:

    If they call you into audit, you need to prove it. Could you lie? Sure. Just be careful what you post on open forums like this.

  8. Bought a house as primary residence in 1990.
    Lived in said house until 2004, became a rental.
    Last transaction on rental house was 2011, did a re-fi while married.
    Acquired said house Dec. 2013 through a divorce.
    Moved back into house Dec, 2017 as primary residence.
    Sold house in June, 2021.
    Am I eligible for $250,000. exclusion except for recapture depreciation.
    Will I not need Sale of Home tax forms due to exclusion?
    If so, what tax forms are required for recapture depreciation and how much depreciation is required since I was sole owner only since Dec. 2013.

  9. Diane Kennedy says:

    Hi Carmen,

    You will need to recapture the previous depreciation on Form 4797. Just a note, it is considered Section 1250 property for the rental property. (That confuses a lot of people!)

    From what you said, it sounds like you qualify for the exclusion except for depreciation.

  10. Gregg S says:

    I have a question about section 121 capital gain exemption on sale of primary residence. I bought a vacation home in Oct 2012, it became my primary home in March 2015 (I did not rent it out during the vacation home period, it was just my getaway). I sold the home in Oct 2021. So, it was my primary home for more than 24 months in the five years before I sold. When I fill out the tax form, it asks how many months since 2008(!) I used the house as something other than my primary residence. I enter in the time prior to using it as my primary, and it seems to prorate my exemption! No one mentions anything about this in any documentation I read. Am I doing something wrong? I expect the full exemption.

  11. Diane Kennedy says:

    If you received rent during that time after 12/31/2008 before it was your primary residence, you will need to prorate the amount of capital gains exclusion. If it was a second home and not used for business or rental purposes, than you do not need to prorate.

    IRS Publication 523 has information regarding the exceptions to the capital gain exclusion.

  12. Timothy Senak says:

    Hi Diane,

    Great advice; as always. Does it matter if we purchased on oceanfront condo in 2012 as a vacation home? We did rent it during prime seasons through a management company before we moved into it as our primary residence in 2017. We didn’t take depreciation at all since we purchased it, but do we need to pay on imputed depreciation recapture?

  13. Diane Kennedy says:


    If you first rented it prior to moving into it, you’ll have to prorate the capital gain exclusion. So, let’s say you sell it now, in 2022. You would have 5 years as a rental and 5 years as a primary residence. If you’re married, filing jointly, that means you would have 1/2 of the possible capital gain exclusion available…. or 1/2 of $500K, ie, $250K.

    If you had depreciated the property while it was a rental, you will need to recapture that depreciation up to the amount of gain that you have.

  14. Mandie says:

    Bought house in 2003 and moved in.
    Rented it out 2008-April 2015.
    Moved back in April 2015.
    Sold it 2021.
    I know I qualify for the Capital Gains exclusion, but do I have to recapture the depreciation since it was my primary residence on the date of sale? If so, would this be on Form 4797?
    Thank you very much for any guidance!

  15. Diane Kennedy says:

    Hi Mandie:

    Yes, you will need to recapture all of that past depreciation.

    Thanks for your comments!

  16. Jon says:

    My wife and I both owned our own houses prior to being married 3 and 1/2 years ago. She’s had hers for about 30 years, and I’ve had mine for about 18 years. After we were married, she moved into my house. Her house has been empty with the exception of her adult son who has stayed there rent free off and on for a total of about 2 and 1/2 years. She’s been cleaning it out in preparation for selling it. Will the sale be exempt from capital gains?

  17. Diane Kennedy says:

    Jon, as long as she lived in the house for 2 of the previous 5 years prior to sale, she will receive capital gains exclusion.

    It sounds, though, that this won’t be the case for her. Even it closes today, going back 5 years would mean she had only lived there for 1 1/2 years.

    That would mean no capital gains exclusion.

  18. Donna says:

    Bought our property 12 acres and house in 1997, lived there until 2017 then rented it out until July 2021 when we decided we needed to sell due to financial issues (Self-employed and COVID impacted business).
    Out of the last 5 years, we did live in the house for 11months, can this be prorated?
    The house was rented out but not the acreage, does that make a difference on the Capital Gains?

  19. Diane Kennedy says:

    Hi Donna:

    You have two separate issues going on.

    First, do you qualify for any capital gains exclusion at all? If you need to be able to go back 5 years and show you have lived there for 2 years. From the details you gave, it sounds like that is not true.

    There is a possible “out” though and that’s if you qualify for unforeseen circumstances.

    See this blog:

    You will need to recapture depreciation and prorate the amount of capital gain exclusion. If you do qualify for unforeseen circumstances, you will have prorate twice. Once because it wasn’t 2 years and secondly because it was rented after 2009.

  20. Judith says:

    Hi Diane,
    I’m curious to know if the two years out of five rule means those two must be consecutive or can it be one year with a break for one year and then back in the primary residence for another year?

  21. Diane Kennedy says:

    Hi Judith:

    That’s an interesting question because it can get complicated.

    It is 2 years out of 5, and they don’t have to be consecutive.

    AND… you can have temporary absences away from your home. (Generally speaking, temporary absence is less than 12 months).

    So let’s say you own your home for 2 years. During that time you live in it for 6 months, then decide to take a cruise around the world for 4 months. During that time, your house is an AirBnB.

    You come back, live in your house for 3 months and then take a job in another state so you move there for 3 months. Your house is rented out during that time. You move back for 8 months.

    In total you’ve now owned this house as your principal residence for 24 months, or 2 years.

    You qualify for the 2 out of 5 years capital gains exclusion.

  22. Kevin Adams says:

    I have a question about a little bit different twist on the 2 out of 5 years. I am planning to purchase vacant land and build. As soon as I purchase, I will be claiming it as my primary residence and living in an RV on the property while building my home. If I decide to sell after residing “On the property” for over 2 years, can I take the exclusion, or do I have to base it on the CoO (certificate of occupancy) of the new home?

  23. Diane Kennedy says:

    Hi Kevin:

    I love this question! You do have a new spin on it. Technically, once you are living on the property, the 2 year clock starts ticking. After that, all you’re doing is improving the property.

    As long as you are living in the trailer you’ve put on the property, use that as your address etc… you have established residency. (And this assumes you don’t have any other residence)

  24. I’m selling my home to a buyer who wants me to take back a mortgage. He is paying a premium for the property so I’m inclined to do it even though the down payment is lower than I would like. My question pertains to the LTCG. The price will leave me with a gain, and my question is when is it owed? Is it the year I sell, or when the mortgage balloons in five years? thanks.

  25. Diane Kennedy says:

    Hi Lee:

    In most cases, you will be able to use the “Installment Method” to recognize the gain and pay tax on it over time.

    The interest will be taxable as interest income, but the principal portion of the payments will be partially basis and partially gain.

    For example, if you have a basis of $200,000 and sell the property for $400,000 (assuming no capital gain exclusion), then 50% of principal payments will be taxable.

    Let’s say in year one you collect $2,000 in principal payment and it’s 50% taxable. That means $1,000 would be taxable.

    Later when the note is paid off, the rest of the capital gains will be taxable.

    There is an exception if you are considered a real estate dealer. If that’s the case, then you cannot use the Installment Sale Method and it is immediately all taxable.

  26. Loretta Binfet says:

    I am a resident of one state and in that state, I rent a twin home. For the winters I reside in another state for 5 – 6 months of the year. This is where I purchased a home where I intended to retire when the time came. Since then, plans changed, and I needed to sell that home and continue to reside in the state where I am resident. I have since then purchased a home. My questions: do I qualify to exclude the sale of the home? Do I need to pay taxes on the full capital gain?
    Thank you,

  27. Ken says:


    I purchased a home on October 20, 2020. I have a sale set to close on October 5, 2020. Can I use the exclusion if it’s not 2 years to the day?

  28. Diane Kennedy says:

    Hi Loretta:

    I’m not sure what a “twin home” means, but I’m going to guess this means that you rent part of a duplex or two party home.

    If I understand correctly, you live part of the year in a home you own and part of the year in a rental property.

    The first question will be where is your residency? Where do you file taxes, have your driver’s license, register to vote and spend most of the time?

    If it is in the state in which you own the home, then the next question is whether you have spent 2 out of the last 5 years with that as a residence.

    And finally, was the home you own ever a rental since 2009?

    Those will be the things to determine before you can answer the question as to capital gains exclusion.

  29. Diane Kennedy says:


    I’m not sure I understand your question. You bought the property October 20,2020 but then closed on it 10/5/2020?

  30. John Antanies says:


    Stumbled upon your website looking for something else. My side hack is real estate (own 15 properties in AZ and CO) but I have friends who owned 5 or so properties and subsequently moved into each for two years, then sold, ostensibly to claim the exclusion and not recapture depreciation.

    When did this change (pro-rating LTCG) go into effect? Did you always have to recapture depreciation?

    Personally, it is about time the IRS started cracking down on this behavior.

  31. Diane Kennedy says:

    Hi John:

    We have had to recapture depreciation on the sale for as many years as I can remember.

    The change as far as moving into previous rentals and then needing to pro-rate the appreciation came into effect 1/1/2009.

  32. Nancy Amundson says:

    Hi Diane,
    We have owned a 2nd home in Az for 20 years. Our primary residence is in WI. Every year we have spent anywhere from 3-6 months living in the AZ home. We had our mail forwarded to AZ and worked from our home there. We never opened a bank account in AZ though as there was no need. Last June we sold the AZ home and, as we have lived in the home for more than 24 months out of the past five years, I think this qualifies us for the 2 out of 5 rule when it come to capital gains on the sale. Our accountant is reluctant to do this – saying we might have a hard time proving it – since we never had a bank account there. How exatly are we supposed to prove it?

  33. Diane Kennedy says:

    Hi Nancy:

    There is a lot to proving residency. Some of the things that would be questioned include: What address you use on your tax return, where is your driver’s license, where are your cars registered, where are you registered to vote and, as mentioned, where is your bank account and investments.

    It’s too bad you didn’t have a little planning on this before the sale. You likely could have reduced or even completely eliminated the capital gains tax.

    It’s a good question that I’m going to cover in a blog soon.

Leave a Comment


  • Three weekly emails with free tax updates
  • Exclusive deals on products and services
  • FREE Video: How to Write Off Practically Anything