To exclude up to $250,000 (single) or $500,000 (married filing jointly) in profit from taxes, you must have owned and used the home as your primary residence for at least 24 months (730 days) within the five years prior to the sale.
Taxed as short-term capital gains at your ordinary income tax rate (up to 37%). buying and selling a house within 2 years
Taxed as long-term capital gains , typically at rates of 0%, 15%, or 20% depending on your income. To exclude up to $250,000 (single) or $500,000
If you sell before this 24-month mark, your profit is generally taxed as capital gains. To exclude up to $250