Question: how long do you have to purchase a home after selling one?
Answer: If you sell your home and buy another, the capital gains exclusion requires you to have lived in the first home for at least two years of the five years prior to the sale. The home is your primary residence.