There are many rules in place to limit tax free exchanges with a related party. Most are designed to prevent basis shifting. A tax-free exchange with a related party cannot be for tax avoidance purposes. If a property is sold at a gain, and the cash and the property remain within the family, the transaction will violate the tax avoidance intent of Section 1031.
An easy way to avoid this problem is to have your related party also do a 1031 exchange. If you sell a rental house and buy an office building from your father, the transaction will violate Section 1031 unless your father also does a 1031 exchange on his sale. Assuming he does an exchange, your gain will be deferred, your dad's property will remain within the family, but since the cash doesn't (because your dad did an exchange), the transaction will not violate the related party rules.
Another requirement of a related party exchange is that the related party property must remain within the family for two years following the exchange. Otherwise, the exchange is retroactively taxable.
Cross your t’s and dot your i’s and make sure you hire an experienced Qualified Intermediary and Tax Professional.