Many tax benefits are available to you when you sell your principal residence. However, the rules are complex and personal guidance is necessary to take full advantage of these benefits so that you and your tax advisor can best work together to minimize the tax on the gain. This financial guide discusses the key rules so that you and your tax advisor can best work together to minimize the tax on the gain.
Table of Contents
The IRS allows an exclusion of up to $250,000 of the gain on the sale of your main home ($500,000 if you are married and file a joint return. Most taxpayers can take advantage of the exclusion and will not have to pay any tax on the sale of a main home as long as they meet the IRS ownership and use tests (see below).
If you don't qualify for the exclusion, your gain exceeds the exclusion, or you used part of the property in business or for rent, you have a taxable gain and must report the sale of your main home on your tax return on IRS Form 8949, Sales and Other Dispositions of Capital Assets and Schedule D.
Usually, the home you live in most of the time is your main home. In addition to a standard dwelling unit, your home can also be a houseboat, mobile home, cooperative apartment, or condominium.
Key information for determining gain or loss is the selling price, the amount realized, and the adjusted basis.
The selling price is the total amount you receive for your home. It includes money, all notes, mortgages, or other debts assumed by the buyer as part of the sale, and the fair market value of any other property or any services you receive. Next, you deduct the selling expenses such as commissions, advertising, legal fees, and loan charges paid by the seller from the selling price.
The difference is the "amount realized." If the amount realized is more than your home's "adjusted basis," discussed later, the difference is your gain. If the amount realized is less than the adjusted basis, the difference is your loss.
However, it does not include amounts you received for personal property sold with your home. Personal property is property that is not a permanent part of the home, such as furniture, draperies, and lawn equipment.
The following discussion covers how to determine your gain or loss if you trade one home for another, if your home is foreclosed on or repossessed or if you transfer a jointly owned home.
Jointly owned home. If you and your spouse sell your jointly owned home and file a joint return, you figure and report your gain or loss as one taxpayer. If you file separate returns, each of you must figure and report your own gain or loss according to your ownership interest in the home. Your ownership interest is determined by state law.
If you and a joint owner other than your spouse sell your jointly owned home, each of you must figure and report your own gain or loss according to your ownership interest in the home. Each of you applies the exclusion rules individual basis.
Trading homes. If you trade your old home for another home, treat the trade as a sale and a purchase.
Foreclosure or repossession. If your home was foreclosed on or repossessed, you have what the IRS calls a disposition and will need to determine if you have ordinary income, gain, or loss. The amount of your gain or loss depends on whether you were personally liable for repaying the debt secured by the home and whether the outstanding loan balance is more than the fair market value (FMV) of the property.
If you were not personally liable for repaying the debt secured by the home, the amount you realize includes the full amount of the outstanding debt immediately before the transfer. This is true even if the FMV of the property is less than the outstanding debt immediately before the transfer.
If you were personally liable for repaying the debt secured by the home and the debt is canceled, the amount realized on the foreclosure or repossession includes the smaller of the outstanding debt immediately before the transfer reduced by any amount for which you remain personally liable immediately after the transfer, or the Fair Market Value (FMV) of the transferred property.
In addition to any gain or loss, if you were personally liable for the debt you may have ordinary income. If the canceled debt is more than the home's fair market value, you have ordinary income equal to the difference. However, the income from the cancellation of debt is not taxed to you if the cancellation is intended as a gift, or if you are insolvent or bankrupt.
Transfer to spouse. If you transfer your home to your spouse, or to your former spouse incident to your divorce, you generally have no gain or loss, even if you receive cash or other consideration for the home. Therefore, the rules explained in this Guide do not apply.
If you owned your home jointly with your spouse and transfer your interest in the home to your spouse, or to your former spouse incident to your divorce, the same rule applies. You have no gain or loss.
If you buy or build a new home, its basis will not be affected by the transfer of your old home to your spouse, or to your former spouse incident to divorce. The basis of the home you transferred will not affect the basis of your new home.
You will need to know your basis in your home as a starting point for determining any gain or loss when you sell it. Your basis in your home is determined by how you got the home. Your basis is its cost if you bought it or built it. If you acquired it in some other way, its basis is either its fair market value when you received it or the adjusted basis of the person you received it from.
While you owned your home, you may have made adjustments (increases or decreases) to the basis. This adjusted basis is used to figure gain or loss on the sale of your home.
Cost as Basis
The cost of property is the amount you pay for it in cash or other property.
Purchase. If you buy your home, your basis is its cost to you. This includes the purchase price and certain settlement or closing costs. Your cost includes your down payment and any debt, such as a first or second mortgage or notes you gave the seller in payment for the home.
Seller-paid points. If you bought your home after April 3, 1994, you must reduce the basis of your home by any points the seller paid, whether or not you deducted them. If you bought your home after 1990 but before April 4, 1994, you must reduce your basis by the amount of seller-paid points only if you chose to deduct them as home mortgage interest in the year paid.
Settlement fees or closing costs. When buying your home, you may have to pay settlement fees or closing costs in addition to the contract price of the property. You can include in your basis the settlement fees and closing costs that are for buying the home. You cannot include in your basis the fees and costs that are for getting a mortgage loan. A fee is for buying the home if you would have had to pay it even if you paid cash for the home.
Settlement fees do not include amounts placed in escrow for the future payment of items such as taxes and insurance.
Some of the settlement fees or closing costs that you can include in the basis of your property are:
Some settlement fees and closing costs not included in your basis are:
Real estate taxes. Real estate taxes for the year you bought your home may affect your basis, as follows:
If you pay taxes that the seller owed on the home up to the date of sale and the seller does not reimburse you, then the taxes are added to the basis of your home.
If you pay taxes that the seller owed on the home up to the date of sale and the seller does reimburse you, then the taxes do not affect the basis of your home.
If the seller pays taxes for you (taxes owed beginning on the date of sale) and you do not reimburse the seller, then the taxes are subtracted from the basis of your home.
If the seller pays taxes for you (taxes owed beginning on the date of sale) and you reimburse the seller, then the taxes do not affect the basis of your home.
Construction. If you contracted to have your house built on land you own; your basis is the cost of the land plus the amount it cost you to complete the house. This amount includes the cost of labor and materials, or the amounts paid to the contractor, and any architect's fees, building permit charges, utility meter, and connection charges, and legal fees directly connected with building your home. Your cost includes your down payment and any debt, such as a first or second mortgage or notes you gave the seller or builder. It also includes certain settlement or closing costs. You may have to reduce the basis by points the seller paid for you. If you built all or part of your house yourself, its basis is the total amount it cost you to complete it. Do not include the value of your own labor or any other labor you did not pay for, in the cost of the house.
Cooperative apartment. Your basis in the apartment is usually the cost of your stock in the co-op housing corporation, which may include your share of a mortgage on the apartment building.
Condominium. Your basis is generally its cost to you. The same rules apply as for any other home.
If your home was acquired in a transaction other than a traditional purchase (such as gift, inheritance, trade, or from a spouse), you may have to use a basis other than cost, such as fair market value.
Home received as gift. If your home was a gift, its basis to you is the same as the donor's adjusted basis when the gift was made. However, if the donor's adjusted basis was more than the fair market value of the home when it was given to you, you must use that fair market value as your basis for measuring any loss on its sale.
If you use the donor's adjusted basis to figure a gain and get a loss, and then use the fair market value to figure a loss and get a gain, you have neither a gain nor a loss on the sale or disposition.
If you received your home as a gift and its fair market value was more than the donor's adjusted basis at the time of the gift, you may be able to add to your basis any federal gift tax paid on the gift. If the gift was before 1977, the basis cannot be increased to more than the fair market value of the home when it was given to you. On the other hand, if you received your home as a gift after 1976, you would add to your basis the part of the federal gift tax paid that is due to the home's "net increase" in value (value less donor's adjusted basis).
Home received from spouse. You may have received your home from your spouse or from your former spouse incident to your divorce.
In community property states (Arizona, California, Idaho, Louisiana, Nevada, New Mexico, Texas, Washington, and Wisconsin), each spouse is usually considered to own half of the community property. When either spouse dies, the fair market value of the community property becomes the basis of the entire property, including the portion belonging to the surviving spouse. For this to apply, at least, half of the community interest must be included in the decedent's gross estate, whether or not the estate must file a return.
Home received in trade. If you acquired your home in a trade for other property, the basis of your home is generally its fair market value at the time of the trade. If you traded one home for another, you have made a sale and purchase. In that case, you may have realized a capital gain.
Adjusted basis is your cost or other basis increased or decreased by certain amounts.
Increases to basis include:
Decreases to basis include:
Discharges of qualified principal residence indebtedness. You may be able to exclude from gross income a discharge of qualified principal residence indebtedness. This exclusion applies to discharges made after 2006 through the end of 2025 (Consolidated Appropriations Act, 2021) and also applies to debts forgiven as the result of a written agreement entered into before January 1, 2026, even if the actual discharge happens later. If you choose to exclude this income, you must reduce (but not below zero) the basis of your principal residence by the amount excluded from gross income.
Amount eligible for the exclusion. The exclusion applies only to debt discharged after 2006 and before 2025. The maximum amount you can treat as qualified principal residence indebtedness is $750,000 ($375,000 if married and filing separately). Prior to December 31, 2020, this amount was $2 million ($1 million if married filing separately). You cannot exclude from gross income discharge of qualified principal residence indebtedness if the discharge was for services performed for the lender or on account of any other factor not directly related to a decline in the value of your residence or to your financial condition.
Improvements. These add to the value of your home, prolong its useful life, or adapt it to new uses. You add the cost of improvements to the basis of your property.
Here are some other examples:
Repairs. These maintain the good condition of your home. They do not add to its value or prolong its life, and you do not add their costs to the basis of your property.
Recordkeeping. You should keep records of your home's purchase price and purchase expenses. Furthermore, you should also save receipts and other records for all improvements, additions, and other items that affect the basis of your home.
The records you should keep include:
If you sell your main home after May 6, 1997, you may qualify to exclude up to $250,000 of the gain ($500,000 if married filing jointly) on the sale of your main home; however, to claim the exclusion, you must meet the ownership and use tests. This means that during the 5-year period ending on the date of the sale, you must have:
Exception. If you owned and lived in the property as your main home for less than 2 years, you can still claim an exclusion in some cases. However, the maximum amount you may be able to exclude will be reduced.
If you sell the land on which your main home is located, but not the house itself, you cannot exclude any gain you have from the sale of the land.
If you have more than one home, only the sale of your main home qualifies for excluding the gain. If you have two homes and live in both of them, your main home is the one you live in most of the time.
The two years of ownership and use during the five-year period don't have to be continuous. You meet the tests if you can show that you owned and lived in the property as your main home for either 24 full months or 730 days during the five-year period. Short temporary absences, e.g., for vacations, are counted as periods of use, even if you rent out the property during that time.
Ownership and Use Tests Met at Different Times. You can meet the ownership and use tests during different 2-year periods. However, you must meet both tests during the 5-year period ending on the date of the sale.
Special Situations. There are a number of special situations that may result in exceptions to the general rules.
Individuals with Disabilities. There is an exception to the 2-out-of-5-year use test if you become physically or mentally unable to care for yourself at any time during the 5-year period. You qualify for this exception to the use test if, during the 5-year period before the sale of your home:
Under this exception, you are considered to live in your home during any time that you live in a facility (including a nursing home) that is licensed by a state or political subdivision to care for persons in your condition.
If you meet this exception to the use test, you still have to meet the 2-out-of-5-year ownership test to claim the exclusion.
Gain postponed on sale of previous home. For the ownership and use tests, you may be able to add the time you owned and lived in a previous home to the time you lived in the home on which you wish to exclude gain. You can do this if you postponed all or part of the gain on the sale of the previous home because of buying the home on which you wish to exclude gain.
Previous home destroyed or condemned. For the ownership and use test, you add the time you owned and lived in a previous home that was destroyed or condemned to the time you owned and lived in the home on which you wish to exclude gain. This rule applies if any part of the basis of the home you sold depended on the basis of the destroyed or condemned home. Otherwise, you must have owned and lived in the same home for 2 of the 5 years before the sale to qualify for the exclusion.
Members of the uniformed services or Foreign Service, employees of the intelligence community, or employees or volunteers of the Peace Corps. 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 (defined later) as a member of the uniformed services or Foreign Service of the United States, or as an employee of the intelligence community.
You can choose to have the 5-year test period for ownership and use suspended during any period you or your spouse serve outside the United States either as an employee of the Peace Corps on qualified official extended duty (defined later) or as an enrolled volunteer or volunteer leader of the Peace Corps. This means that you may be able to meet the 2-year use test even if, because of your service, you did not actually live in your home for at least the required 2 years during the 5-year period ending on the date of sale.
If you and your spouse file a joint return for the year of sale, you can exclude gain (up to $500,000) if either spouse meets the ownership and use tests.
Death of spouse before sale. If your spouse died before the date of sale, you are considered to have owned and used the property as your main home during any period of time when your spouse owned and used it as his or her main home.
Home transferred from spouse. If your home was transferred to you by your spouse (or former spouse if the transfer was incident to divorce), you are considered to have owned it during any period of time when your spouse owned it.
Use of home after divorce. You are considered to have used property as your main home during any period when you owned it and your spouse or former spouse is allowed to use it under a divorce or separation instrument. Such use is added to your own use before or after divorce.
Special Exceptions Affecting Exclusions
Home destroyed or condemned. If your home is destroyed or condemned after May 6, 1997, any gain (e.g., due to insurance proceeds) qualifies for the exclusion.
Expatriates. You cannot claim the exclusion if the expatriate tax applies to you because you have renounced their citizenship and one of the primary purposes was to avoid U.S. taxes.
More Than One Home Sold During the Two-Year Period. You cannot exclude gain on the sale of your home if, during the two-year period ending on the date of the sale, you sold another home at a gain and are excluding all or part of that gain. If you cannot exclude the gain, you must include it in your income.
However, you can claim a reduced exclusion if you sold the home due to a change in health or place of employment or experienced unforeseen circumstances such as natural disasters, death, or unemployment (eligible unemployment compensation). When counting the number of sales during a two-year period, do not count sales before May 7, 1997.
The $250,000 (or $500,000) exclusion is reduced according to a formula whose numerator is the number of days of qualified ownership or use (or between sales of the homes) and the denominator is 730 days (for 2 years). If married filing jointly, duplicate the same calculation for your spouse's ownership and use (or days between sales).
Change in Place of Employment. You may qualify for a reduced exclusion if the primary reason for the sale of your main home is a change in the location of employment of a qualified individual.
Health. You may qualify for a reduced exclusion if the sale of your main home is because of health if your primary reason for the sale 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.
Unforeseen Circumstances. You may qualify for a reduced exclusion if the sale of your main home is because of an unforeseen circumstance if your primary reason for the sale is the occurrence of an event that you could not reasonably have anticipated before buying and occupying that home. You are not considered to have an unforeseen circumstance if the primary reason you sold your home was that you preferred to get a different home or because your finances improved.
Home used in business. So long as the business use takes place in the same dwelling unit as your main home, the exclusion is not affected by business use, with this exception: You cannot exclude the part of your gain that is equal to any depreciation allowed or allowable for the business use of your home after May 6, 1997. The 2 out of 5-year use-as-the-main-home test is not applied to deny exclusion for gain allocable to business use in the same dwelling unit, except for allowable depreciation.
If you financed your home under a federally subsidized program (loans from tax-exempt qualified mortgage bonds or loans with mortgage credit certificates), you may have to recapture all or part of the benefit you received from that program when you sell or otherwise dispose of your home. You recapture the benefit by increasing your federal income tax for the year of the sale. You may have to pay this recapture tax even if you can exclude your gain from income under the rules discussed earlier; that exclusion does not affect the recapture tax.
Adjusted basis: This is your basis in the property increased or decreased by certain amounts. See Adjusted Basis, earlier in this Guide, for a list of items that increase or decrease your basis in the property.
Amount realized: This is the selling price of your old home minus your selling expenses.
Basis: Your basis in the property is determined by how you got it. If you bought or built the property, your basis is what it cost you. If you got the property in some other way, your basis will be determined differently. See Cost as Basis and Basis Other Than Cost earlier in this Guide for more information.
Date of sale: If you received a Form 1099-S, Proceeds From Real Estate Transactions, the date should be shown in box 1. If you did not receive this form, the date of sale is the earlier of (a) the date title transferred or (b) the date the economic burdens and benefits of ownership shifted to the buyer. In most cases, these dates are the same.
Fair market value: Fair market value is the price at which property would change hands between a willing buyer and a willing seller, neither having to buy or sell and both having reasonable knowledge of the relevant facts. Sales of similar property, on or about the same date, may be helpful in figuring the fair market value of the property.
Fixing-up expenses: These are costs you pay for decorating or repairing your home to make it easier to sell. You may be able to deduct fixing-up expenses from the amount realized on the sale of your old home.
Gain: Your gain on the sale of your home is the amount realized minus the adjusted basis of the home you sold.
Improvements: These add to the value of your home, prolong the life of the property or allow the property to be used for new purposes. The cost of improvements increases your basis in the property.
Main home: This is the home you live in most of the time. It can be a house, houseboat, cooperative apartment, condominium, etc.
Repairs: These maintain your property in good condition. They differ from Improvements in that they do not add much to the value or life of the property and their cost does not increase your basis in the property.
Seller-financed mortgage: This is a mortgage from the buyer of your home. The buyer makes mortgage payments to you.
Selling expenses: Selling expenses include items such as sales commissions and advertising and legal fees you pay to sell your home. Selling expenses also usually include loan charges you pay on the buyer's behalf as an aid in selling your home, such as loan placement fees or "points."
Settlement fees (or closing costs): These are amounts paid in purchasing your property in addition to the contract price. Some of these amounts are added to the basis of the property and some are deductible as itemized deductions. Certain amounts are neither deductible nor added to the basis of the property. See Settlement fees or closing costs under Basis, earlier in this Guide, for more details.