To qualify for a like-kind exchange under Section 1031 of the Internal Revenue Code, both the relinquished property (the property being sold) and the replacement property (the property being acquired) must be held for investment, ie. for the purpose of appreciation.
For example, if you are selling a commercial office building, you can use the proceeds to acquire another commercial office building, a retail or rental property, or even vacant land, and still qualify for a like-kind exchange. However, you cannot exchange real estate for other types of assets, such as stocks, bonds, or personal residences, as they are not considered like-kind properties for the purpose of a 1031 exchange.