In this article

Kooky
Builder of Shaka, the payment router that pays every agent their commission on closing date.
About Kooky and Shaka →Most people who sell the home they live in across the United States pay no federal income tax on the profit. That is not because a home sale is outside the tax system. It is because a single provision, section 121 of the Internal Revenue Code, lets a seller leave a large part of the gain out of income, provided a short list of conditions is met. The conditions are simple to state and easy to misread, and the difference between meeting them and missing them by a few weeks can be a six-figure sum.
This guide follows the Internal Revenue Service's own explainer, Publication 523, Selling Your Home, in the edition written for preparing 2025 returns. It covers the two limits, what counts as a main home, the three tests the IRS calls ownership, residence and look-back, the rules for couples, surviving spouses and service members, the partial exclusion for sellers who move early, and how the gain is measured in the first place. Everything here is federal. State income taxes follow their own rules and are not covered.
Internal Revenue Service, Publication 523 (2025), for use in preparing 2025 returns.
The two limits and what they apply to
Publication 523 sets the maximum exclusion of gain at US$250,000 for a seller who files as single or as married filing separately, and at US$500,000 for a married couple filing a joint return. The figure is a ceiling on gain, not on price. A home that sells for US$900,000 may produce a gain well under the limit if it was bought for US$700,000, and a modest home held for decades may produce a gain above it.
Related readWestern Australia: transfer duty and land tax on a home, with examplesThe exclusion applies only to the sale of a principal residence, which the publication also calls the main home. A second home, a holiday home and a rental property held as an investment do not qualify as such, although time spent living in a property can change its status, as later sections show. The publication adds that a person can have only one main home at a time.
Gain that fits inside the limit is simply left out of income. Gain above it is taxable, and the publication directs it to Form 8949 and Schedule D of Form 1040. This guide does not give the tax rates that then apply: the capital gains rates for the 2026 tax year were not verified for this article, and they depend on the seller's other income.
What counts as a main home
The IRS does not use a single mechanical rule to decide which property is the main home. Publication 523 describes a test of facts and circumstances, and says the most important factor is where the owner spends the most time. For someone with one property the question never arises. It matters for owners who divide the year between two places, or who moved out some time before selling.
When time alone does not settle the matter, the publication lists other factors that point to a main home: the address used on the owner's tax returns, the address on voter registration, and the address on a driver's licence. None of these is decisive alone. Together they show where a person's life is centred.
Related readAustralia's main residence CGT exemption: the 6-year and 6-month rulesThe type of building is not a barrier. According to the publication, single-family homes, condominiums, cooperative apartments, mobile homes and houseboats can all qualify. What matters is that the property is where the owner actually lives, not what it is built from or whether it stands on land.
Vacant land next to the home can be brought inside the exclusion in some cases. Publication 523 says adjacent vacant land can be included if the land sale and the home sale take place within two years of each other and the tests are met, and that the two sales are then treated as one transaction. One limit therefore covers both, not one limit each.
The ownership test: 24 months in five years
The first of the three tests looks at title. The seller must have owned the home for at least 24 months out of the five years leading up to the date of sale. Ownership before that five-year window does not count towards the 24 months, but in practice anyone who has owned continuously for two years or more passes.
For a married couple filing jointly, the publication says only one spouse needs to meet the ownership requirement. A home that one spouse bought before the marriage, and that stayed in that spouse's sole name, can still support the joint limit so long as the other conditions are satisfied.
Because the test counts back from the date of sale, that date matters. Publication 523 says the date of sale is the one shown in box 1 of Form 1099-S, the information return issued for real estate transactions at closing. Where no Form 1099-S is issued, the date of sale is the earlier of two events: the date title transferred, or the date the economic benefits and burdens of ownership passed to the buyer. A seller who is close to the 24-month line has good reason to know which of these dates applies before a closing date is agreed.
Related readDubai Land Department fees for gifts, heirs, mortgages and long leasesThe residence test: 730 days that need not be continuous
The second test looks at use. The seller must have used the home as a residence for a total of at least 24 months, which the publication also expresses as 730 days, during the same five-year period. Two details make this test more flexible than it first appears.
First, the months do not have to be continuous. An owner who lived in the home for 14 months, rented it out for a year, then moved back for 10 months has 24 months of residence. Second, ownership and residence do not have to overlap. Each is counted separately across the five years, so a person who rented a home for a year, then bought it and lived there for a further year, would have 24 months of residence but only 12 of ownership, and would fail the ownership test, not the residence one.
Short absences do not break the count. Publication 523 says that vacations and other short temporary absences count as time lived in the home, even if the home was rented out while the owner was away. The publication does not turn "short" into a number of days in the passages read for this guide, so a long absence is a matter for the facts of the case.
There is one specific relief for owners who can no longer live independently. A person who becomes physically or mentally unable to care for themselves, and who lived in the home for at least 12 months of the five years, may count time spent in a licensed care facility towards the residence requirement, according to the publication.
Related readNew York City moves pied-à-terre exemption deadline to 13 OctoberFor the joint limit, the residence rule is stricter than the ownership rule: each spouse must meet it individually. A couple where one partner moved in only eight months before the sale does not qualify for the full US$500,000, however long the other has lived there.
| Test | What it requires | Joint filers |
|---|---|---|
| Ownership | Owned the home at least 24 months in the 5 years before the sale | One spouse is enough |
| Residence | Lived in it at least 24 months (730 days) in the same 5 years, not necessarily in a row | Each spouse must meet it |
| Look-back | No gain excluded on another home sold in the 2 years before this sale | Each spouse must meet it |
Internal Revenue Service, Publication 523 (2025), eligibility test and maximum exclusion worksheet.
The look-back test and automatic disqualification
The third test prevents the exclusion from being used again and again in quick succession. A seller meets the look-back requirement if no other home was sold in the two years before this sale, or if another home was sold but no exclusion was taken on it. Put the other way, the exclusion may be taken only once in any two-year period.
The wording matters for people who move often. Selling two homes within two years is not forbidden, and the second sale is not penalised. It only means that one of the two gains cannot be fully excluded.
Before any of the three tests, the publication's eligibility test begins with a step it calls automatic disqualification. Two situations close the door outright. The first is a home acquired through a like-kind exchange, the tax-deferred swap of investment property under section 1031, during the past five years. The second is a seller who is subject to expatriate tax. In either case the exclusion is not available, whatever the periods of ownership and residence.
Like-kind exchanges and the home sale exclusion can also meet at the other end, when a property that was partly a home is itself exchanged. Publication 523 notes that where sections 121 and 1031 both apply to the same transaction, section 121 is applied first, citing Revenue Procedure 2005-14.
Related readNew South Wales transfer duty: 2026-27 rates and first home reliefCouples, surviving spouses and divorce
The joint limit of US$500,000 comes with its own conditions. The publication's worksheet makes it available when both spouses meet the residence and look-back requirements and one or both meet the ownership requirement. When only one spouse meets the residence test, the worksheet does not simply deny everything. It asks whether either spouse would qualify for the US$250,000 limit as a single person, and if neither does, whether either qualifies for a partial exclusion.
A worked example shows the effect. Assume a couple filing jointly sell a home for a gain of US$400,000. One spouse has owned and lived in it for six years; the other moved in ten months before the sale; neither has sold another home. The first spouse meets all three tests and the second fails the residence test, so on these assumptions the couple's limit is US$250,000 and the remaining US$150,000 of gain is not covered, unless the second spouse separately qualifies for a partial exclusion under the rules described below. Had both lived there for 24 months, the whole US$400,000 would have fallen within the joint limit.
Three family situations receive specific treatment in Publication 523.
- Death of a spouse. A surviving spouse who has not remarried may claim up to US$500,000 if the sale takes place within two years of the spouse's death and the tests are met.
- Transfer in a divorce. A person who receives the home from a spouse or former spouse in a divorce may count the time that spouse owned it towards the ownership requirement.
- A former spouse still living there. The home is treated as a person's residence for any period in which the former spouse lives in it under a divorce or separation instrument. An owner who moved out years ago under such an arrangement does not lose the residence test for that reason.
Service members and extended duty
People posted away from home for long periods would often fail a five-year test through no choice of their own. Publication 523 lets members of the Uniformed Services, the Foreign Service and the intelligence community, and Peace Corps personnel, elect to suspend the five-year test period while they are on qualified official extended duty.
The publication defines that duty as a call to active duty for more than 90 days or for an indefinite period, served at a duty station at least 50 miles from the main home or while living in government quarters. The suspension cannot run for more than 10 years, so the test period and the suspension together cannot exceed 15 years. Only one property can be covered at a time. The election is made by filing the return for the year of sale, and the publication says it can be revoked at any time.
Related readSingapore Buyer's Stamp Duty and ABSD: rates for every buyer profileIn practice the rule lets a service member who lived in a home for two years, was then posted elsewhere for eight years and sold on return, still count the two years of residence, because the eight years of duty are left out of the five-year window.
The partial exclusion for an early sale
A seller who fails one of the three tests is not always left with nothing. Publication 523 allows a partial exclusion when the main reason for the sale was a work-related move, a health issue or an unforeseeable event.
A work-related move qualifies when the new work location is at least 50 miles farther from the home than the old one was, or, for someone with no previous work location, when the new job is at least 50 miles from the home. The publication applies the same measure to a spouse, a co-owner or another person who lived in the home.
A health-related move covers moving to obtain diagnosis, cure, mitigation or treatment of an illness for the seller or a family member, moving to care for a family member, and a change of residence recommended by a doctor.
Unforeseeable events, as the publication lists them, include the home being destroyed or condemned, a casualty caused by a disaster or an act of terrorism, a death, a divorce or legal separation, the birth of two or more children from the same pregnancy, becoming eligible for unemployment compensation, and a change in employment that leaves the household unable to pay basic living expenses. A seller outside these lists may still qualify on the facts if the primary reason for selling was work, health or something unforeseeable, with the timing of the sale among the things considered.
Related readSelling or holding a home in Singapore: SSD and property tax explainedThe amount follows a fixed method set out in the publication's worksheet:
- Take the shortest of three periods: time lived in the home during the five years before the sale, time the home was owned before the sale, and time since the last sale on which an exclusion was taken, if there was one.
- Divide that period by 730 if counted in days, or by 24 if counted in months.
- Multiply the result by US$250,000.
- For a joint return, repeat the calculation for the other spouse and add the two results.
Three worked examples, each assuming the sale qualifies for a partial exclusion and no earlier sale is involved. A single owner who bought, moved in and sold after 12 months has 12 divided by 24, or one half, of US$250,000: a limit of US$125,000. A single owner counting in days with 438 days of ownership and residence has 438 divided by 730, or 0.6, giving US$150,000. A married couple filing jointly where one spouse has 15 months and the other 9 months would compute US$156,250 and US$93,750, for a combined limit of US$250,000.
The fraction applies to the limit, not to the gain
A partial exclusion shrinks the ceiling, and the gain is then measured against it. In the first example above, a seller with a gain of US$90,000 and a reduced limit of US$125,000 would still have the whole gain inside the limit.
Measuring the gain: amount realized and adjusted basis
All of the above concerns how much gain may be left out. The gain itself comes from a three-part calculation in Publication 523.
- Amount realizedThe sale price less selling expenses such as commissions, advertising and legal fees.
- Adjusted basisThe purchase price plus qualifying settlement costs and improvements, less adjustments such as depreciation.
- Gain or lossThe amount realized minus the adjusted basis.
The sale price is wider than the cash received. The publication's worksheet counts cash, the fair market value of other property received and debts the buyer takes over. Selling expenses then come off, and the publication gives sales commissions, advertising and legal fees as examples.
Basis starts with what the home cost and grows with some of the costs of buying it. According to the publication, the settlement costs that may be added include abstract fees, legal fees, recording fees, survey fees, transfer or stamp taxes and owner's title insurance. Others are kept out: casualty insurance premiums, mortgage points and appraisal fees required by a lender do not form part of basis.
Work done on the home over the years falls into two groups. Improvements that add to the value of the home, prolong its useful life or adapt it to new uses increase basis. Repairs that merely keep the home in good condition generally do not. For a long-held home, records of improvements are therefore what stands between a seller and a larger taxable gain.
Related readTexas and Florida property tax: exemptions, caps, appeals and billsThe starting point is different when the home was not bought. For an inherited home, the publication says basis is generally the fair market value at the date of death. For a home received as a gift, it is generally the donor's adjusted basis, so the previous owner's history carries over.
A worked example with assumed figures. A single owner bought a home for US$300,000, paid US$4,000 of settlement costs that count towards basis, and later spent US$46,000 on improvements: an adjusted basis of US$350,000. The home sells for US$670,000 with US$40,000 of selling expenses, an amount realized of US$630,000. The gain is US$280,000. If the owner meets all three tests, US$250,000 is excluded and US$30,000 remains to be reported. A married couple filing jointly who both met the tests would exclude the whole US$280,000.
A loss on a main home is not deductible
Publication 523 states that when the calculation produces a loss, the seller cannot deduct it. No tax is owed on the proceeds, but the loss does not reduce other income.
Rental use, home offices and depreciation
A home that has also earned income raises two separate issues: depreciation, and periods when the property was not the owner's main home.
On depreciation the publication is direct. The part of the gain equal to depreciation allowed or allowable for business or rental use after 6 May 1997 cannot be excluded, and is recognised as what the tax code calls unrecaptured section 1250 gain. The publication's own illustration is small and clear: a seller with a gain of US$13,000 who had claimed US$2,000 of depreciation recognises US$2,000 and may exclude the remaining US$11,000.
Where the business or rental space sits makes a difference. For space within the living area, such as a home office in a spare bedroom, the publication says the gain generally does not need to be split between home and business, and nothing goes on Form 4797, although the depreciation is still recaptured. A separate structure or unit, such as a rented half of a duplex or a shop beneath an apartment, is treated differently: basis and amount realized are allocated between the two parts, and the gain on the separate part generally cannot be excluded and is reported on Form 4797. The exception is a separate part that the seller both owned and lived in for at least two of the five years ending on the date of sale.
Related readUAE property tax: VAT on sales and rents, corporate tax on incomeThe second issue is what the publication calls nonqualified use. Any period after 2008 in which the property was not used as a principal residence is, with certain exceptions, nonqualified use, and the gain allocable to that period cannot be excluded under section 121(b)(5). This is the rule that limits the exclusion for a rental or holiday property converted into a main home shortly before a sale. The exceptions and the allocation worksheet were not among the passages read for this guide, so they are not set out here.
Reporting, subsidies and foreign sellers
Publication 523 names the forms for each kind of leftover gain: Form 8949 and Schedule D of Form 1040 for gain above the exclusion, Form 4797 for the business portion, and Form 6252 for an instalment sale. The detailed conditions under which a fully excluded sale must still be shown on a return were not re-read for this guide and are left to the publication itself.
Two side issues can add tax even when the gain is covered. Sellers who financed the home with a federally subsidised mortgage may owe a recapture of that subsidy, reported on Form 8828, and the publication tells sellers to check for subsidies received in the nine years before the sale. Sellers whose lender forgave part of the mortgage are pointed to a separate exclusion for cancelled debt on a principal residence, which the publication says was extended to 31 December 2025, including debt discharged under an arrangement agreed in writing before 1 January 2026.
The exclusion is not reserved for US residents. An IRS page on FIRPTA withholding, reviewed on 21 July 2026, says a nonresident alien who sells a US home may use the section 121 exclusion if the eligibility test in Publication 523 is met. Nonresident aliens generally cannot file a joint return, so each claims a share on a separate Form 1040-NR, with a maximum of US$250,000. The same page explains that the buyer of US real property from a foreign seller must generally withhold 15% of the amount realized, and that this can exceed the tax actually owed when the exclusion applies. In that case the seller may ask the IRS for a withholding certificate so that the buyer withholds less.
Two limits on this guide should be plain. The amounts and tests above are those of the edition of Publication 523 written for 2025 returns; whether any law passed in 2026 alters the US$250,000 and US$500,000 limits was not checked. And the outcome for any one sale turns on dates, records and family circumstances that a general account cannot settle.