Thank you for contacting me about your Tax issue. I will work hard to help you understand the issue clearly.
Just as an amplification of the other expert's response, imagine the following case:
You purchase a rental building for $400K and sell it for $750K.
You took out a $300K loan, interest-only, to buy the original property, and you used $100K cash out of pocket for the remainder of the $400K purchase price.
From the sale proceeds, you pay back the bank $300K and put $300K in your bank account and have $150K left you want to invest in a new rental. Assume no closing costs and no depreciation taken or allowed since the property was raw land.
Based on the rules
of a 1031 tax-free exchange, you would have an actual gain of (750-400) = 350K. However, you want to postpone as much gain as possible for tax purposes.
Since the total gain is $350K, but you are taking $300K out in cash, the maximum gain you can now postpone is $50K (350-300). The amount used to repay the bank loan is neither gain nor cash used outside of the transaction.
You would then have to pay tax on the $300K gain you took out as cash. Compare that to if you took the entire amount out and paid capital gains currently. Due to the size of the transaction, you will pay at least 15% and perhaps as much as 23.8% tax on the capital gain, so postponing tax on $50K saves you $7500 to $12000. Compare that savings to the cost of the exchange transaction itself to see if you are making much of a difference.
Since you did not indicate your cost basis in the rental or the amount of depreciation, I cannot determine whether you would have a gain that could be offset, or if the distribution of cash would exceed your entire gain. If the distribution of $320K is more than the entire gain, a 1031 tax-free exchange would have no value to you at all since there would be nothing to defer.