I lived in a house for 6 years, I then moved out and rented it for 3 years (Jan 1 2016 - dec 31 2018) if I sell the house next few months do I have to pay capital gains ?

The house was rented for exactly 3 years and now I’m trying to decide if I should continue renting or sell but I’m trying to avoid paying capital gain taxes