Investors & landlords

Capital gains tax will be entered on the tax return for the year that the house sale was closed.  The day you move into a new house does not matter.  To qualify for the exclusion you must have used the house as your primary residence for two of the previous five years.

 

Since you rented the house for the last two years and lived in it for over six years, you qualify for the exemption.