Both properties must be similar enough to qualify as "like-kind." Like-kind property is property of the same nature, character or class. Quality or grade does not matter. Most real estate will be like-kind to other real estate. For example, real property that is improved with a residential rental house is like-kind to vacant land. One exception for real estate is that property within the United States is not like-kind to property outside of the United States. Also, improvements that are conveyed without land are not of like kind to land.
https://www.irs.gov/newsroom/like-kind-exchanges-under-irc-code-section-1031