How Long Must You Live in a Home as Your Primary Residence?

There is no single answer to how long you must live in a home as your primary residence, because the number depends on which rule you’re trying to satisfy. For the federal capital gains tax exclusion, you need 24 months of use within the five years before you sell. For a mortgage lender, you generally need to move in within 60 days of closing and stay for at least 12 months. State homestead exemptions, in-state tuition, and insurance coverage each run on their own calendars. Mixing these rules up is where people lose money.

The IRS Two-Year Rule

The tax rule most homeowners care about is the capital gains exclusion under Section 121. If you sell your main home at a profit, you can exclude up to $250,000 of the gain from taxable income, or up to $500,000 if you’re married filing jointly.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

To qualify, you have to pass two tests. You must have owned the home for at least two of the five years before the sale, and you must have used it as your primary residence for at least two of those same five years. The 24 months of use don’t have to be consecutive. Someone who lived in the home for 14 months, moved out, and returned for another 10 months within the five-year window still meets the use test.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

There’s also a frequency cap. You can only claim this exclusion once every two years. If you sold another home and used the exclusion within the two years before your current sale, you’re locked out for this one.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

You can only have one primary residence at a time. When someone splits time between two homes, the IRS applies a facts-and-circumstances test that looks at where you physically spend the majority of your time, along with your driver’s license, voter registration, tax return address, and proximity to work, banks, and family.2Internal Revenue Service. Publication 523 (2025), Selling Your Home

Selling Before Two Years

If you have to sell before hitting 24 months, you may still qualify for a partial exclusion when the sale is triggered by a recognized reason. The IRS accepts several categories:

  • A change in employment: a new job, a transfer, or a job loss that makes basic expenses unaffordable.
  • Health issues affecting you, your spouse, a co-owner, or another resident.
  • The home being condemned, destroyed, or damaged by a natural disaster or act of terrorism.
  • Major life events including the death of a resident, divorce or legal separation, or the birth of multiple children from the same pregnancy.
2Internal Revenue Service. Publication 523 (2025), Selling Your Home

The partial exclusion is prorated. Take the shortest of three periods (time lived in the home during the five-year window, time owned, or time since you last used the exclusion), divide that by 24 months, and multiply by $250,000 or $500,000. If you lived in the home for 18 months before a qualifying job move, your cap becomes 18 ÷ 24 × $250,000, or $187,500.2Internal Revenue Service. Publication 523 (2025), Selling Your Home

The Mortgage Lender Clock

Tax law and mortgage law run on separate tracks, and the mortgage clock is much tighter. When you finance a primary residence, the lender gives you a lower interest rate than it would for an investment property, and in exchange you sign occupancy documents at closing.

The standard requirement for conventional, FHA, and VA loans is that you move into the home within 60 days of closing and occupy it as your primary residence for at least 12 months. Lenders may permit delays in narrow cases, such as active-duty military deployment or a home that needs major repairs before it’s habitable, but these require documentation and lender approval.

Violating occupancy terms lets the lender declare the full loan balance immediately due. Making false statements on a mortgage application is also a federal crime, with penalties of up to $1,000,000 in fines, up to 30 years of imprisonment, or both.3Office of the Law Revision Counsel. 18 USC 1014 – Loan and Credit Applications Generally

The line between fraud and a change of plans is intent. Moving in as planned and then being transferred eight months later is life. Signing occupancy documents when you never intended to live in the home is fraud.

Situations That Change the Timeline

Property Acquired Through a 1031 Exchange

If you bought the property as an investment through a like-kind exchange and later converted it to your primary residence, you can’t use the capital gains exclusion until you’ve owned the property for at least five years from the acquisition date. That is longer than the standard two-year rule, and it catches investors who move into former rentals.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

Military and Foreign Service

Members of the uniformed services or Foreign Service on qualified extended duty can elect to pause the five-year ownership-and-use clock for up to 10 years, stretching the lookback window to as much as 15 years. A service member deployed overseas for eight years can still meet the residency test by combining time spent in the home before and after deployment.4eCFR. 26 CFR 1.121-5 – Suspension of 5-Year Period for Certain Members of the Uniformed Services and Foreign Service

Surviving Spouses

If your spouse dies and you sell the home within two years of the death, you may still claim the full $500,000 exclusion instead of the $250,000 individual limit, provided you haven’t remarried before the sale, neither spouse used the exclusion on another home within the prior two years, and the ownership and residency tests are met (counting your late spouse’s time toward them).2Internal Revenue Service. Publication 523 (2025), Selling Your Home

Prior Rental Use and Depreciation

Meeting the two-year residency test doesn’t erase time the property spent as a rental. Any period after January 1, 2009 during which the home was not your primary residence counts as “nonqualified use,” and the portion of your gain tied to that period doesn’t qualify for the exclusion. The IRS divides total nonqualified-use time by total ownership time and applies that fraction to your gain. Time after your last day of primary-residence use doesn’t count against you.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence

Buy a house in 2016, rent it for four years, then live in it for six before selling in 2026, and you’ve owned it for 10 years with four years of nonqualified use. Forty percent of the gain is taxable regardless of the exclusion; the remaining 60% can be excluded up to the cap.

Depreciation is a separate issue. If you claimed depreciation while renting the home or using part of it as a home office, that depreciation is never sheltered by the exclusion. You’ll owe tax on depreciation taken (or allowable) for any period after May 6, 1997, at the unrecaptured Section 1250 gain rate of up to 25%, even if the rest of your gain is fully excluded.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence5Internal Revenue Service. Sales, Trades, Exchanges 3

State Homestead and Residency Timelines

State-level benefits use their own clocks. A homestead exemption reduces your property tax bill and can protect some home equity from creditors. Nearly every state offers a version, and time requirements vary. Most states require that you own and occupy the home as your primary residence by a specific date, often between January 1 and March 1 of the tax year, and some require a minimum period of residency before you can file. Application windows commonly run from January through June, and missing the deadline usually pushes the benefit to the following year.

Residency timelines also govern other benefits. Many public universities require 12 months of established domicile before a student qualifies for in-state tuition, and voter registration and certain state programs carry their own thresholds.

Bankruptcy filers can also claim a federal homestead exemption protecting a set amount of equity. The dollar amount and covered filing period are set by statute.6Office of the Law Revision Counsel. 11 USC 522 – Exemptions

Insurance Occupancy Rules

Your homeowners policy is written for a specific occupancy type. A standard policy assumes someone lives in the home regularly, and most insurers limit or deny coverage once a home has been vacant for 30 to 60 days. If you split time between properties, travel for extended periods, or convert the home to a rental, tell your carrier before the change. A vacancy endorsement or landlord policy costs more than standard coverage and far less than an uninsured loss.

Penalties for False Residency Claims

Claiming the capital gains exclusion on a home that wasn’t actually your primary residence means paying the tax you should have paid, plus interest. If the IRS finds the underpayment was due to fraud, it can add a civil penalty equal to 75% of the underpaid amount.7Internal Revenue Service. Estate and Gift Tax Penalty and Fraud Procedures Auditors look for patterns: short-term ownership, repeated exclusions on flipped properties, and inconsistent addresses across filings.

How to Prove Where You Live

When residency is challenged, documentation decides the outcome. The strongest records are your driver’s license, voter registration, and the address on your federal and state tax returns.2Internal Revenue Service. Publication 523 (2025), Selling Your Home Supporting evidence includes utility bills showing consistent usage, bank statements, homeowner’s insurance, and mail delivery records. For people who work remotely or travel, cellphone location data and medical provider records near the home help establish a pattern of presence.

The point is consistency. A driver’s license listing a different address from your tax return is exactly the inconsistency that triggers questions in an audit or a mortgage review, so line the paperwork up before anyone asks.