Generally, when you’re single, you can exclude up to $250,000 of gain from the sale of a home ($500,000 if you’re married filing jointly) when the home is used as a primary residence for two years in a five-year period that ends on the date of sale. Tax law also provides for a partial exclusion when the time and ownership requirements are not met, if the primary reason for the sale is unforeseen circumstances. “Unforeseen” means events you could not have reasonably anticipated before buying the home and moving in. How flexible is the definition? Recently, the IRS allowed a partial exclusion when a family living in a two-bedroom, two-bath condominium gave birth to another child and needed a larger residence before the two-year rule was met.