Deductions & credits

based on current tax law

 

it would have to be your principal residence for at least 2 years (the years do not have to be consecutive) out of 5 years prior to the sale. put another way 730 days during the years it is your principal residence in up to the 5 years before the sale. your home must be the principal residence for the year for the days in the year you lived there to count.