capital gains - two homes

I have a vacation rental home that I want to move into and live for around 10 years, but don’t really want to sell my primary residence, as I may want to return, and my son wants to live in the house during that time.  If in the future I decide to sell both properties to move to a smaller forever home, how can I sell both my vacation rental and my primary residence and avoid capital gains?