My 2 bros and I inherited land from my g-ma when she passed. We are sellin the land and will pay capital gains. Can I avoid cg if I apply money made to pay off my home?

Grandmother passed away and gifted us a farm. How to avoid paying capital gains tax?