I think somebody might have given you some bad info. The $500,000 limit you mentioned applies with respect to gain on the sale of your principal residence. A married couple pays no federal income tax on any gain on the sale of a principal residence, up to $500,000 gain. Any gain in excess of that amount is taxed at the normal capital gains rate of 15%. The limit is $250,000 for single people.
The allure of Section 1031 exchanges has, in my view, been dimished somewhat since the capital gains rate is now only 15%. Nevertheless, many taxpayers seek to defer paying taxes even at 15% (plus possibly deferring taxes to a state) by reinvesting the sale proceeds in qualifying property. For example, if your farm, ranch or investment property has appreciated greatly due to encroaching cities you might cash out by selling and then pay 15% capital gains tax. But what if you intend to buy a different farm, ranch, etc. soon thereafter? In that case you would generally like to avoid paying the taxes, so that you have more cash in hand with which to make your replacement property purchase. So alternatively, you could arrange a qualified 1031 exchange and use all the cash to buy a replacement farm or ranch (or some other qualifying property --- but not a personal residence) and avoid paying the tax currently. The tax on the sale is deferred, perhaps for a very long time, since the tax cost of the replacement property is generally the actual cost you pay minus the gain you deferred on the sale of your original property. So until you actually sell that replacement property you essentially keep deferring the tax on the gain from the sale of the initial property. There are some very specific, pretty much hard & fast rules that you must comply with in order to have a valid 1031 exchange, particularly if it is a 3 party exchange or, most commonly found, a deferred 1031 exchange.