You can legally sell anytime, but selling within a year or two can mean higher transaction costs relative to equity and may affect your capital gains exclusion. Lenders and programs may have their own occupancy requirements, so check your loan documents before quickly turning around and selling.?