Exclusion of Capital Gain on the Sale of Your Home

Introduction
There may or may not be federal income tax consequences when you sell your home. If you sell your principal residence at a loss (i.e., for less than you purchased it), you can’t deduct the loss on your federal income tax return. If you sell your principal residence at a gain, you may be taxed on the capital gain. If you’re eligible, though, you may be able to exclude up to $250,000 (up to $500,000 for married couples filing jointly) from federal income tax. Your ability to exclude the capital gain depends on several factors.
The IRS has issued regulations explaining the circumstances under which a taxpayer may qualify for the full or partial homesale gain exclusion.
The Housing and Economic Recovery Act of 2008 modifies the homesale exclusion beginning January 1, 2009. See Modified exclusion for sales and exchanges made after December 31, 2008 below for more information.
What is your principal residence?
The homesale exclusion applies only to the sale of your principal residence. Although you might own several homes, you can have only one principal residence. The home in which you spend most of your time during the year will ordinarily be considered your principal residence. However, the final regulations list other factors that are also relevant in determining your principal residence. These factors include (but are not limited to) the following:
- The address listed on your income tax returns, driver’s license, and automobile and voter registrations
- Your place of employment
- Your mailing address for bills and correspondence
- The location of your family members
- The place you maintain your bank accounts
- The location of your memberships (e.g., places of worship, clubs, etc.)
For purposes of qualifying for the capital gain exclusion, you must have an ownership interest in the residence (i.e., legal title), rather than simply a right to occupy (as a tenant would have). Single family homes can qualify as principal residences, along with condominiums, co-ops, mobile homes, houseboats, and trailers (assuming they have living accommodations that include a sleeping space, toilet, and cooking facilities).
An investment in a retirement community will not qualify as your principal residence unless you receive equity in the property.
How do you calculate capital gain for purposes of the homesale exclusion?
If you own your principal residence, it will generally be considered a capital asset. The sale of a capital asset ordinarily results in either a capital gain or a capital loss. If the sale price of your residence exceeds your adjusted basis (the initial cost of your home, plus amounts you’ve paid for capital improvements, less any depreciation and casualty losses claimed for tax purposes) in the home, you’ll realize a capital gain. (For more information about adjusted basis, see IRS Publication 523, Selling Your Home.)
Capital improvements add value to your home, prolong its life, or adapt it to a new use. The installation of a deck or a built-in swimming pool would be an improvement. However, regular repairs and maintenance are not considered improvements and are not generally included in the tax basis of your home.
Assume you bought a house for $150,000 and finished the basement three years later for $10,000. You sell the house 15 years later for $250,000. Your capital gain (which may be excluded from your income if you meet the necessary requirements) equals $90,000 ($250,000 – $160,000).
If the capital gain from the sale of your home is entirely excluded from federal income taxation, you don’t have to report the sale transaction on your income tax return. However, if part or all of your capital gain is taxable, you must report the transaction on Schedule D of your federal income tax return.
If the sale price of your principal residence is less than your adjusted basis in the residence, you’ll realize a capital loss. You generally can’t claim such a loss as a deduction on your federal income tax return.
For information about additional tax issues surrounding the sale of your principal residence, see Sale of Principal Residence: Tax Considerations.
Under what conditions may you exclude gain from the sale of your principal residence?
In general
If you sell your principal residence at a gain, you may be able to exclude from federal income tax all or part of the capital gain. If you meet the requirements, you can exclude up to $250,000 (up to $500,000 for married couples filing jointly) of the capital gain, regardless of your age.
You can generally exclude the gain only if you owned and used the home as your principal residence for at least two out of the five years preceding the sale (the two years do not have to be consecutive).
Under the Military Family Tax Relief Act of 2003, members of the uniformed services and foreign service personnel may elect to suspend the 2-out-of-5-year requirement during any period of qualified official extended duty up to a maximum of ten years. This extension is effective for sales made after May 6, 1997. There is a minimum one-year window of time beginning November 5, 2003 for the purposes of filing a claim for refund or credit that might otherwise be barred.
Under the Tax Relief and Health Care Act of 2006, the Tax Technical Corrections Act of 2007, and the Heroes Earnings Assistance and Relief Tax Act of 2008, “employees in the intelligence community” (as defined in the Act) may elect to suspend the 2-out-of-5-year requirement during any period in which they are serving extended duty up to a maximum of ten years. This extension is generally effective for sales made after December 20, 2006. However, for sales made after December 28, 2007 and before June 18, 2008, to qualify, an employee had to move from one duty station to a new duty station located outside of the United States.
An individual, or either spouse in a married couple, can generally use this exemption only once every two years (but see below for partial exemption rules).
What if you are unmarried and own your principal residence jointly with another unmarried taxpayer? According to the final regulations, each of you may be eligible to exclude from gross income up to $250,000 of gain from the sale of the house.
Assume you and your spouse bought a home for $200,000. Ever since, you lived in it as your principal residence, have not sold any other houses, and filed joint federal income tax returns each year. In addition, you’ve never used any portion of the house for business or rental purposes. Fifteen years later, you sell the house for $500,000. The entire $300,000 gain is excludable. That means you don’t have to report your home sale on your income tax return.
Surviving spouse’s home sale exclusion
Previously, a surviving spouse was entitled to the $500,000 exclusion only if he or she filed a joint return with the deceased spouse’s estate, which can only occur for the tax year in which the deceased spouse dies. The Mortgage Forgiveness Debt Relief Act of 2007 extended the period of time in which the surviving spouse has to take the $500,000 home sale exclusion. For sales on or after January 1, 2008, the sale of a jointly-owned and occupied residence is entitled to the $500,000 exclusion provided the sale occurs no later than two years after the date of the deceased spouse’s death.
Property acquired through a like-kind exchange
The American Jobs Creation Act of 2004 provides that the exclusion on the sale or exchange of a principal residence does not apply if the residence was acquired in a like-kind exchange within the prior five years. This provision applies to sales or exchanges after October 22, 2004.
Vacant land
The final regulations clarify the treatment of vacant land. According to the final regulations, gain on the sale of vacant land may be excluded in some cases. The homesale exclusion applies to the sale or exchange of vacant land that you owned and used as part of your principal residence if the following conditions are met:
- The vacant land must be adjacent to land containing the dwelling unit (i.e., your principal residence); and
- The sale or exchange of the dwelling unit occurs within two years before or after the sale or exchange of the vacant land.
For purposes of the homesale exclusion, sales or exchanges of the dwelling unit and the vacant land are treated as one transaction (even if the two sales take place at different times). Therefore, only one maximum limitation amount of $250,000 ($500,000 for qualifying joint filers) applies to the combined sales or exchanges of the vacant land and dwelling unit.
Assume that you purchased a house (which rested on one acre of land), along with a vacant lot adjacent to the property for a total price of $150,000. You’ve used the home (and both lots) as your principal residence ever since. On January 1 of last year, you sold your home for $250,000. On January 1 of this year, you sell the vacant lot adjacent to the property for $50,000. You’ve sold no other homes and are a single taxpayer. The two sales will be treated as one transaction. Therefore, your entire $150,000 gain may be excluded from taxation.
Prior to issuance of the final regulations, the sale of vacant land that did not include a dwelling unit did not qualify as a sale of the taxpayer’s residence unless the sale of vacant land was one of a series of transactions that included the sale of the house.
Ownership by a trust
If your principal residence is held by a trust, and you’re treated as the owner of the trust for federal income tax purposes under the grantor trust rules, you’ll be treated as the owner (and seller) of the home for purposes of the homesale exclusion rules.
Assume you establish a revocable trust and transfer your principal residence to the trust, naming yourself as trustee. (For federal income tax purposes, the grantor trust rules apply.) You continue to live in the home as your principal residence. After living in the home for a total of 15 years, you sell the home for a $100,000 gain. You haven’t sold any other homes and you file as a single taxpayer. You’ll be able to exclude the entire $100,000 gain.
In the case of grantor trusts and the homesale exclusion, the final regulations simply codified the holdings of past revenue rulings.
Mixed-use property (principal residence used partly for business, investment, or rental purposes)
In the past, the IRS took the position that if a principal residence was used partially for residential purposes and partially for business purposes (mixed-use property), any capital gain on the sale of the house would have to be prorated. Only the part of the gain allocable to the residential portion was eligible for exclusion.
The final regulations, however, have adopted a more liberal position. So long as both the residential and non-residential portions of the property are within the same dwelling unit (e.g., one room in the home is used as a home office), all of the gain from the home sale (except for gain resulting from certain depreciation deductions) is eligible for the capital gain exclusion. However, gain is allocated if the business portion of the home is separate from the dwelling unit (e.g., an office in a converted detached garage).
Capital gain on the sale of your home will not qualify for the exclusion to the extent of any depreciation deductions attributable to the business use of your home after May 6, 1997.
Assume a self-employed accountant buys a home and, 15 years later, sells the home at a $20,000 gain. Although the house was always used as his principal residence, the accountant used one room within the house as his business office. Over the years, the accountant claimed $2,000 of depreciation deductions for his office. Under the final regulations, $18,000 of the capital gain will be tax-free. Only the $2,000 of the gain equal to the depreciation deductions will be taxable. The taxable amount will be considered unrecaptured Section 1250 gain, which is taxed at a rate of 25%.
If the accountant’s office had been located in a converted detached garage on his property, he would have to treat the sale as two separate transactions and pay tax on the gain allocable to the converted garage.
Multi-family homes
Be careful if you rent part of your principal residence to tenants. If you converted part of your residence into an apartment, or if you sell a multi-family house, you may not be able to exclude the gain from the rental portion of your house.
Suppose you buy a three-story townhouse and convert the basement level (which has a separate entrance) into a separate apartment by installing a kitchen and bathroom there. You also remove access from the interior stairway that leads from the basement to the upper floors. After the conversion, you use the first and second floors of the townhouse as your principal residence and rent the basement level to tenants for four years. During that period, you claim depreciation deductions of $2,000. You sell the entire property, realizing a gain of $18,000.
Because the basement apartment was considered a separate dwelling unit, you must allocate the capital gain between the portion of the property that you used as your principal residence and the portion of the property that you rented. You may exclude from taxation only the non-rental portion. Assuming that the gain allocable to the rental portion of the property came to $6,000, you’d recognize the $6,000 as income ($2,000 of which is gain from depreciation deductions and $4,000 of which is adjusted net capital gain).
Capital gain realized on the sale of pure investment properties and residences other than your principal residence (for example, vacation homes) cannot be excluded from taxation under the homesale exclusion rules.
Modified exclusion for sales and exchanges made after December 31, 2008
Under the Housing and Economic Recovery Act of 2008, gain from the sale of a principal residence home will not be excluded from gross income for periods that the home was not used as the principal residence (i.e., “nonqualifying use”). Nonqualified use is a new concept that essentially means any period of time that the property is not occupied as the principal residence by the homeowner or the homeowner’s spouse. This requires a look back at the cumulative use of the property. The rule is meant to prevent the use of the homesale exclusion for appreciation that is attributable to periods during which a residence is used as a vacation home, second home, or rental property before its use as the principal residence.
The rule determines the amount of the exclusion on a pro rata basis. The amount of gain allocated to periods of nonqualified use is the amount of gain multiplied by a fraction, the numerator of which is the aggregate period of nonqualified use during which the property was owned by the taxpayer and the denominator of which is the period the taxpayer owned the property. For the purpose of calculating capital gain, the period of nonqualifying use is any period of time, beginning on or after January 1, 2009, that the property is not used as a primary residence. Any period of what would otherwise be considered nonqualifying use that occurs prior to January 1, 2009 is disregarded for the purpose of determining the capital gain allocation.
John buys a condo in 2020. John already owns a house that he uses as his primary residence. John lets his son, Mark, live in the condo for two years while he attends graduate school. John moves into the condo in 2022 and makes it his primary residence for the next three years. John sells the condo in 2025 after owning the property for five years. During the five-year period during which John owned the condo, there were two years of non-qualifying use (when Mark lived there) and three years of qualifying use (when John lived there). The ratio of nonqualifying use is 2/5, or 40%. Forty percent of the gain will be taxable, and 60% can be excluded, up to the exclusion limit of $250,000.
Temporary absences not exceeding a total of two years in aggregate will not jeopardize qualifying use. A property can maintain its status as a primary residence even if the homeowner is absent due to change in employment, health conditions, or other unforeseen circumstances (see below for more information).
Nonqualified use does not include any portion of the five-year period (used to determine eligibility for excluding capital gain) that is after the last date that the property was used as a principal residence. For example, a taxpayer who owns and lives in a home as a principal residence for the first two years of the five-year period will not have to treat the remaining three years as nonqualified use, even if the home is not the taxpayer’s principal residence for the three years immediately preceding the sale of the home.
Can you qualify for a partial capital gain exclusion if you don’t meet the relevant tests?
Partial or reduced exclusion available
To qualify for the homesale exclusion, you generally must own and use a home as your principal residence for at least two out of the five years preceding the sale. In addition, an individual (or either spouse in a married couple) can generally use this exemption only once every two years. However, a partial exclusion may be available even if you fail to meet these tests. You may claim a partial homesale exclusion if the primary reason for selling your house is a change in place of employment, for health reasons, or for certain other unforeseen circumstances. Generally, you must establish by the facts and circumstances of your situation that your home sale was for one of these reasons.
The IRS has issued regulations that clarify the meaning of the above conditions (change in place of employment, health reasons, and unforeseen circumstances). In addition, the regulations identify various “safe harbors” that will automatically establish that a sale is for one of these reasons.
Calculation of reduced exclusion
If you qualify for a reduced exclusion, the maximum exclusion amount of $250,000 ($500,000 for a married couple filing jointly) is limited to the percentage of the two years that you otherwise fulfilled the homesale exclusion requirements. You multiply the maximum $250,000 (or $500,000) exclusion by a fraction. The numerator of the fraction is the shorter of (a) the total time you owned and used your home as your principal residence during the five years ending on the sale date, or (b) the period of time since you last used the homesale exclusion and before the date of the current sale. The denominator of the fraction is two years. The proportion may be figured in days or months.
Suppose you owned and used a home as your principal residence for one year before selling. (Therefore, you haven’t met the two-out-of-five-years test.) You sell the home at a $40,000 gain. Assume you’ve never used the homesale exclusion before and you’re single. If you qualify for a reduced exclusion, you’re eligible to exclude up to $125,000 of gain ($250,000 x ½). Therefore, you’ll be able to exclude the entire $40,000.
Change in place of employment
The regulations provide that a sale or exchange of a principal residence is by reason of a change in place of employment if the taxpayer’s primary reason for the sale or exchange is a change in the location of the employment of a qualified individual. (Qualified individuals include the taxpayer, the taxpayer’s spouse, a co-owner of the home, or a member of the taxpayer’s household.)
The regulations adopt a safe harbor for satisfying the change-in-place-of-employment condition. A home sale will be considered related to a change in place of employment if a qualified person’s new place of work is at least 50 miles farther from the old home (the principal residence that was sold) than the old workplace was from that home.
This is the same distance rule that applies for the moving expense deduction. (The moving expense deduction has generally been suspended for 2018 to 2025.)
If a disposition does not satisfy this safe harbor, you may still qualify for a reduced exclusion if the facts and circumstances indicate that a change in place of employment is the primary reason for the sale or exchange of your principal residence.
Health
The regulations provide that a sale or exchange of a principal residence is by reason of health if the taxpayer’s primary reason for the disposition is:
- To obtain, provide, or facilitate the diagnosis, cure, mitigation, or treatment of disease, illness, or injury of a qualified individual, or
- To obtain or provide medical or personal care for a qualified individual suffering from a disease, illness, or injury.
(Qualified individuals include the taxpayer, the taxpayer’s spouse, a co-owner of the residence, a person whose principal place of abode is in the same household as the taxpayer, and certain family members of these individuals.)
A sale or exchange that is simply beneficial to your general health or well-being will not suffice.
The regulations adopt a safe harbor for satisfying the health condition. Health is deemed to be the primary reason for the sale or exchange of the home if a physician recommends a change of residence for reasons of health.
Unforeseen circumstances
The regulations provide that a sale or exchange is by reason of unforeseen circumstances if the primary reason for the sale or exchange is the occurrence of an event that the taxpayer does not anticipate before purchasing and occupying the residence.
The regulations adopt several safe harbors for satisfying the unforeseen circumstances condition. A sale will be considered as occurring primarily because of unforeseen circumstances if any of the following events occur during the taxpayer’s period of use and ownership of the residence:
- Damage to the residence resulting from a natural or man-made disaster, or an act of war or terrorism
- A condemnation, seizure, or other involuntary conversion of the property
- Death
- Divorce or legal separation
- Becoming eligible for unemployment compensation
- A change in employment that leaves the taxpayer unable to pay the mortgage or reasonable basic living expenses
- Multiple births resulting from the same pregnancy
The last five events listed above must involve a qualified individual (the taxpayer, spouse, co-owner, or member of the taxpayer’s household).
If a disposition does not satisfy these safe harbors, you may still qualify for a reduced exclusion if the facts and circumstances indicate that the primary reason for the sale or exchange of your principal residence involves unforeseen circumstances.
For more information, see IRS Publication 523, Selling Your Home.
Prepared by Broadridge Advisor Solutions. © 2025 Broadridge Financial Services, Inc.
The information in this communication or any information within the Financial Advisor On Call domain, and or any attachments to any Financial Advisor On Call communication is strictly confidential and intended solely for the attention and use of the named recipient(s). If you are not the intended recipient, or a person responsible for delivering this email to the intended recipient, please immediately destroy all copies of this email. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. This information must not be disclosed to any person without the permission of Financial Advisor On Call. Please be aware that internet communications are subject to the risk of data corruption and other transmission errors. For information of extraordinary sensitivity, we recommend that our clients use an encrypted method when they communicate with us.
*Financial planning and financial advisory services are offered by FAOC, LLC, a registered investment advisor (RIA). FAOC, LLC, is a wholly-owned subsidiary of Financial Advisor On Call, LLC, a fintech company offering educational services and record management support.