Investors & landlords

Sounds good but....we will be moving into another rental property that will have been rented for 2 years, then we sell and purchase a smaller home after living in it for two years. Could you verify how this is treated. Partial exemption?