How Military Can Avoid Capital Gains on Sale

You may not have to pay tax on all or part of the gain from the sale of your main home.  This is where you live most of the time.  A main home can be a:

  • House
  • Houseboat (cool!)
  • Mobile home
  • Cooperative apartment
  • Condominium

Actually, everybody can get this break on capital gains on the sale of a home under certain circumstances, but military members get an additional benefit that makes it much easier to meet the requirements.

Unfortunately, many CPA and “tax professionals” are unaware of this military benefit.


Cars, stocks, and bonds are capital assets.  A home is also considered a capital asset because it is a significant piece of property.  When you sell it for more than you paid, it’s called a capital gain.

When you sell a stock for more than you paid, you’ll need to report that to the IRS and pay taxes on the capital gain.  Primary homes get excluded from this as long as it fits certain criteria called the ownership and use test.


To be eligible for excluding capital gains on your primary residence, you must be the ownership and use test, as outlined in Publication 3 – Armed Forces Tax Guide.  You will be eligible for the exclusion if, during the 5-year period ending on the date of sale, you:

  • Owned the home for at least 2 years (the ownership test)
  • Lived in the home as your main home for at least 2 years (the use test)

If you don’t fully meet these two tests, you still may be eligible for a partial exclusion.  See IRS Pub. 523 for more details, and consult a smart tax advisor.

This is commonly explained as you have lived in your primary residence 2 of the last 5 years.


It seems like it should be unlimited, right?

Dream on.  The USGOV would never allow that!

You can exclude up to $250,000 of capital gains if filing single / $500,000 if filing jointly. 

This exclusion is allowed each time you sell your main home, but generally not more than once every two years.


Here’s the good part!

You can choose to have the 5-year test period for ownership and use suspended during any period you or your spouse serve on qualified official extended duty as a member of the Armed Forces.  The maximum time of this suspension is 10 years.

The wording above is a little confusing, I don’t really like the way the IRS explains it, but I’ll reword it into something simpler.

Essentially, instead of needing to meet a requirement of living in the property 2 of the last 5 years, military members can meet a requirement of living in the property 2 of the last 15 years.  The 5-year rule can be extended by 10 additional years. 


Obviously, it’s important to make sure you or your spouse qualify as someone who is on qualified official extended duty which is defined as:

  • At a duty station at least 50 miles from your main home, or
  • While you live in government quarters under government orders

You are on extended duty when you are called or ordered to active duty for a period of more than 90 days or for an indefinite period.


I took advantage of this very exclusion on my first primary residence to avoid paying capital gains.

capital gains military
My house in Alexandria, VA

I bought a townhouse in Alexandria, VA in Aug of 2003 for $280,000. I lived in it for exactly 24 months.

Read the story of how I bought that house.

I moved away two years later. It became a rental property as I moved all around the world.  I spent a good portion of my career overseas, with five years in Japan and three beautiful years in Germany.

I sold that house in June of 2016 for a little over $400,000.

Under the original rule, I would not meet the 2 out of the last 5 rule, and this house would be subject to capital gains taxes (ouch!).

The 5 years would have ended in August of 2008. 

Under this awesome military rule, however, we can add on an extra 10 years to the 5 year rule.  I can sell that house anytime before August of 2018.  I sold it in 2016, so the capital gains are not taxed

That’s a big deal!

Want to know my biggest tips for success in real estate?

I offer a FREE 6 Day Video Mini-Course showing methods to buy real estate at a HUGE discount.

Sign up by clicking here.


You cannot apply this rule to more than one property at a time.

According to the IRS’s rules on capital gains, this rule can also apply “to taxpayers who have recently left the military.”  There is no further guidance on what recently would mean legally. 

You will want to talk with a tax attorney about that and use some common sense.  I think a few months out of the military would make sense, and five years after leaving would seem like a stretch!

You don’t have to pay capital gains, but you will be responsible for something called depreciation recapture.  Any depreciation taken or that should have been taken during the time you owned the property needs to be taxed once the property is sold.  This is a complicated subject that my good friend Kate Horrell covers well.

If you move away shy of the two year requirement, you may still qualify for a partial exclusion. See IRS Pub 523 Selling Your Home for more details on the specifics.

If you weren’t eligible for the capital gains exclusion, and wanted to avoid depreciation recapture, this can be performed through a 1031, or like-kind exchange.  This means you purchase a similar property within a specific timeframe using certain rules, and you defer the tax consequences of the sale into the new property. 

Read more about 1031 exchanges.

I’m not a tax attorney or a CPA.  You need to check your situation with professionals before making any important financial decisions.

Have you taken advantage of this awesome opportunity for military members?

I’m proud to say I’m the first military blogger to ever cover this subject!

Ok, that’s not true. Kate Horrell wrote about this a few years ago and did a great job.

Any questions about it?

Leave your comments below.

Check out my post of military real estate mistakes you definitely want to avoid!

Rich on Money

40 thoughts on “How Military Can Avoid Capital Gains on Sale”

  1. Thank you so much for the explanation! I had heard of the rule but I read it to extend the time period to 10 years total and not to 15 years.

  2. Love this blog! Can’t wait to share it with others.

    What happens if you might be just shy of two years? I lived in a home that I bought from 2014 to 2016 but in total, it might not have been 24 months. I had to PCS to another duty station. Can I still benefit from this tax benefit?

    Also, I’m coming up to my five year mark for owning/renting out this home. If I left the military, do I still qualify for the 10 year extension? I’m reading the IRS guidance but it doesn’t clarify whether this benefit is only applicable to those still in the military . Thank you so much for your help!

    • Yes, you can benefit from this rule if you are shy of two years. You have to read this carefully: and you’ll see that if you had to move out of your home because of a change of employment location, you can qualify for a partial exclusion. It explains how to calculate it as well.

      According to the IRS’s rules on capital gains, this rule can also apply “to taxpayers who have recently left the military.” There is no further guidance on what recently would mean legally. To me, recently would be in the last year, but would not be 5 years ago.

      On both of the above, consult a competent tax advisor.

      • Recent probably doesn’t have a definition because of the many different circumstances. As a Navy Command Financial Specialist, I saw a case where the service-member lived in the house until 2010 when transferred. Forced to rent it out while trying to do a a short-sale. Nov 2013 finally tried to change to a deed in lieu and told by WF that they had to be 60 days late on payments in order to qualify. Service member completed all requirements and signed document stating they had moved out in fall of 2014. WF called and said they had an agreement, but it needed to be signed within 3 days. The service member was on travel orders and WF said they couldn’t send it to a different address. Long story, but towards the end, the service member retired in 2016. WF waited until the SCRA protections were null and void and foreclosed the property February 2017. They have only received a 1099A so far. Since it hasn’t been discharged yet, I would assume that this open ended IRS statement would cover this situation whenever they finally get the 1099C.

  3. Thanks Rich for the info! Want to follow up on the two out of 15 years period….so does those two years out of fifteen years have to be consecutively? My husband and I purchased our house in February 2010 and we had it rented out in July 2011. We then moved back to the house in 2016 then my husband was deployed in April 2018 so we sold the house.

  4. I am curious why you say your original 5-year cap would have ended in August 2008 (5 years after you purchased the property). It isn’t 3 years after you started renting your property out. For instance, I bought a property in Feb 2016 and have lived in it for the previous 3.5 years. I am separating from active duty next month and moving out of state. If I sell within the next 3 years can that not be considered as my primary residence for 2 of the previous 5 years? I guess I’m a little confused on if it is 5 years within the purchase date or 5 years from the time it was no longer your primary residence. Thanks for the help! Solid advice!

    • You make a good point that I can clarify. Looking backwards 5 years, you must have occupied it as a primary residence for 2 of those 5 years. It doesn’t have to be consecutive. It could be the first and last year of the 5. It could be broken up any number of ways, but two years out of the last 5 have to be you living in the property as a primary residence.

      • So, it doesn’t have to be consecutive 2 years, but, instead, it the needs to happen within the 5 years?

        So, I bought a house on 1 August 2011 and lived in it until 1 June 2013 (22 months), I then rented it out due to a PCS and moved back in 1 November 2017 through 1 February 2018 (3 months). Will I be exempted from paying taxes on the capital gains because I lived in the house for over 2 years even though it wasn’t consecutive years and also doesn’t fall within 5 years? I’m not sure if I just needed to live in the house during the 10 year suspension or do I have to live in the home for 2 years within the 5 year period? Could the 2 year be broken up? If so, during what time frame? Thank you in advance.

        • Of course, I want you to check with a tax attorney before doing this for real, but I’ll tell you my understanding of the rule from reading the regs carefully. These regs are referenced in the blog post btw.

          For non-military, you need to live in the house 2 of the last 5 years for it to qualify for capital gains free sale up to certain limits.

          This two years does not have to be consecutive. It can be chopped up into different timeframes.

          For military the 5 years is extended by 10 years. This essentially means the rule can be written 2 of the last 15 years. Again, it does not have to be consecutive.

          It can be broken up into two or three different times you lived in that home. Hope this helps.

    • The benefit runs out shortly after you stop active duty service. It doesn’t say how long after, but probably just a couple months. I believe it would not apply to you now.

  5. Your article is very informative and well thought out. I am Active Duty, did a 1031 exchange 2016. I am retiring October 2020 with 34 years of service. The home I exchanged was an investment, a rental, now we intend to move into that house. Your article states we need to live in the house 2/5 years in order to NOT be charged gains. My wife moved into the house 2019. Need solid advice. Am I on track??

    • Walter. If you owned it while it was rented out for 3 years, and then it became your primary residence for the next two years, you are good. You’ll want to consult a tax attorney if you were living separately, but you’ll probably be ok on that if it was out of military necessity.

  6. Walter,
    We bought homes while stationed in two different locations and kept as rental properties when we PCS’d. We lived in both homes for at least two years. We are under contract to sell one of the properties. The tenants in our other home have expressed an interest in buying in the next year and I’m worried about the sale of both houses being less than two years apart. Are there any exceptions for military members who need to sell their homes less then two years apart? I don’t know if the IRS is looking at the total gains within a two year time frame, ($250 single or $500K jointly) or if the sales would have to be 2 years apart to qualify. What do you think? Thx

    • I believe you would have to pick which house is your primary residence, apply the rules to that house, and the other house would not qualify for the capital gains exclusion, but you could do a 1031 exchange on it.

  7. Hi
    Does this apply to spouses?
    I am married to a active duty service member. I bought a house and lived in it while married with family my husband was getting deployed. I am
    Not selling the house can I benefit from this?

  8. Hi Rich,

    We lived in our home 2008-2011, moved out of state and overseas, and had it rented from 2011-2020. Now we are stationed within 50 miles of that home but not living in it and are in the process of selling. Do we still qualify for the exemption?

    Thank you for this informative article.

    • You are supposed to live in the house 2 of the last 15 years, the way I understand the rule. You lived in it from 2009-2011. That satisfies the 2 years. 15 years from 2009 is 2024. Based on my understanding, this would qualify as a tax free sale if it can legally qualify as your primary residence for the entire period. If you bought somewhere else since then, and consider that your primary residence now, then you may not qualify on the other property, which is now an investment property. Don’t take my word for it, have a smart CPA/tax attorney work out your specific situation. Make sure they understand the military exception to the capital gains rule.

  9. Great article. Here’s a question. I’ve had a stock do very well for me and I’m considering selling it. I am a permanent resident of Michigan on orders living in Virginia. How is the capital gain tax for the state handled? E.g. if I sell the stock in 2021 would I pay state capital gains in Michigan or Virginia? The capital gains tax rate is 4.25% in Michigan and Virginia is 5.75%. Obviously, I’ll pay the federal capital gains tax rate regardless, but is it possible to ensure I pay the lower Michigan rate? Would I need to travel back to Michigan to execute the sale while in the confines of the state?

  10. Thanks for writing about this! I’ve been reading through the IRS pubs to figure out if my circumstances fit the eligibility criteria or not, but I’m finding the guidance a little unclear. I bought a house while on Active Duty, lived there 3 years, PCS’ed away, came back and lived in the house again 4 more years while in the Reserves, then moved away and converted the house to a rental while I was in the Guard in another state. I sold the house after renting it out for 6 years. I was a traditional Guardsman so it was part time rather than extended/continuous service. With a 15 year lookback I meet the occupancy requirement. I’m just not sure how the IRS interprets the timeline of my changes in location and service status. Did I read correctly in a previous comment that if we bought another house since while renting out the other one that we may no longer qualify for the exemption? I’ll be sure to ask our tax professional but any thoughts you have would be welcome! Thanks so much.

    • You have to be on qualified official extended duty as a member of the Armed Forces for this to apply. That would have to apply for the enter timeframe you are using it for. That means you have to be on active duty or called to active duty (on orders) for a time period of longer than 90 days. I don’t believe it would apply in your case, but work with a tax professional on it.

  11. Lots of great info here. Do you know what corresponding forms need to be filled out on our personal taxes to show this?

  12. Hi Rich–I understand the military extension/exemption rules as they apply to Federal Income tax–but have you heard of any similar exceptions for state taxes? I’m sure they vary state-to-state…but so far, the state in question (Arizona) only vaguely states:

    “In regards to capital gains, Arizona has no special arrangement. Capital gains included on an individual’s federal adjusted gross income are included on his or her gross income and taxed at the individual’s regular tax rate.”

    Do you think the exception would apply, or not apply, to Arizona state cap gains tax?

  13. Hello, I am of the understanding that only one property can use the stop clock at a time. Are there any more limitations beyond that to prevent from gaming it to maximum advantage?
    For example live in property 1 since 2015 move out 2022 and pause the clock.
    Buy and live in property 2: 2022-2024. Move out and let 3 years go by then pause the clock on property 2 start the clock on property 1 for 3 years. At that point either sell and move into property 2, keeping the clock on property 1 paused for another 5 years or until I move back into it.
    Hope that wasn’t too confusing of a plan.

  14. Hi Rich – quick question. I have been buying houses at each duty station I PCS to. Am I only entitled to use this as a one time benefit? Can this be used on my other homes since they were also considered primary residences at one point? If this is the case would I only need to wait 2 years between sales for the benefit to reset.

    Thank you for your quick and educated responses


Leave a Comment