 now there are rules to qualify for the capital gains exclusion the property you sell must have been your primary residence for at least two out of the last five years now those years don't have to be consecutive just any two years out of the last five