Land ownership is governed by a complex legal framework that varies wildly between jurisdictions. The rules that govern this area of the law are typically set at the state, county and local levels. Many of these rules may come into conflict with one another. Although state-level laws generally take precedence over municipal and county-level laws, long-term conflicts have been known to arise among neighbors and between various government bodies. Such disputes are especially common in densely-populated urban areas and rural areas in which "factory farmers" conduct intensive agriculture operations.
The issue of eminent domain frequently comes into play in disputes over land ownership. Although the concept is quite nuanced, it often pits local governments that wish to seize land for economic development or infrastructure improvements against homeowners who wish to retain the contested pieces of property. In general, eminent domain seizures must occur with the blessing of a local judicial authority and may absolve the affected homeowners from making tax payments on the forced sales of their properties. If you wish to avoid paying taxes on the sale of your land, such a seizure might provide you with the most realistic opportunity for doing so.
However, it's unrealistic to expect that you'll be offered such an opportunity. Despite its prominence in the national legal conversation, eminent domain is invoked relatively rarely. In the vast majority of cases, privately-held land is transferred through the normal private-sale and foreclosure processes.
If you wish to avoid taxation after such a "normal" sale, you'll need to find a new piece of property in short order. According to the terms of the IRS's Section 1031 regulations, an individual who purchases a new piece of property within 180 days of completing the sale of his or her "old" property may be exempt from taxation on the sale's proceeds. In other words, you can avoid paying capital gains taxes on the sale of your home by purchasing another home within a relatively short period of time.
It's important to note that so-called 1031 sales come with many restrictions. First, you must formally announce your intention to purchase a specific home within 45 days of selling your "old" property. Next, you must keep the funds that you've earmarked for this purchase in escrow with a neutral third party. Finally, you must certify that the new piece of property is zoned for residential use and will serve as your primary or secondary residence. Unfortunately, the law doesn't apply to commercial or agricultural land.