U.S. Code § 1031 Exchange of real property:

In summary the 1031 Exchange refers to a section of the U.S. Internal Revenue Code that allows for the deferment of capital gains taxes on the sale of an investment property when it is reinvested in a similar type of property.
Rules:
#1 The properties involved must be of “like-kind,” meaning they must be similar in nature or character. This includes residential rental properties, commercial properties, land, and new development if preformed correctly.
#2 The exchange must involve properties held for investment or for productive use in a trade or business. Personal residences ( your house, your cottage) will not qualify.
Timing:
Identification Period: 
You have 45 days after the sale of the relinquished property to identify potential replacement properties. This means you must provide a limited list of potential replacement properties within 45 day of the close of your first leg. Not just any property will suffice, for this reason best practice includes real due diligence on named replacements.
Exchange Period: The entire exchange must be completed within 180 days of the sale of the original property. Essentially this means you have 180 days counting the 45 to close on a new project.
Qualified Intermediary:
Unfortunately you can’t perform a 1031 on your own. A qualified intermediary (QI) must be used to facilitate the exchange. The QI holds the proceeds from the sale of the original property and uses them to acquire the new property essentially you can’t own first leg and step up or leg up property at the same time or receive the proceeds.
No Cash or Boot:
To completely defer taxes, you cannot receive any cash proceeds. This is sometimes called “boot” (non-like-kind property or cash equivalents) in the transaction.
Equal or Greater Value:
The replacement property must be of equal or greater value than the property sold to fully defer taxes.
Tax Implications:
Failure to adhere to tax code defeats the benefit.