If I sell my primary residence and move into our second home we purchased 3 years ago. Are there tax implications with the gain on the sale of the primary residence?

When do I pay capital gains on a primary residence?