https://www.law.cornell.edu/uscode/text/26/1031
(a)Nonrecognition of gain or loss from exchanges solely in kind
(1)In general
No gain or loss shall be recognized on the exchange of real property held for productive use in a trade or business or for investment if such real property is exchanged solely for real property of like kind which is to be held either for productive use in a trade or business or for investment.