How do we avoid paying capital gains taxes? Do we need to own a property for at least 2 years before we sell it? Does it change anything if the property we own is a mobil

If I sell a primary residence after 1.5 years of ownership filing as married can I avoid paying capital gains taxes? Is there an amount of gain that isn't taxable?