Capital gains tax on rental home sale after buying new house

I have just purchased our second home, and intend to rent out our current primary residence for the next 2 years. Will I pay capital gains tax if i sell the rental after 2 years?