How to Do a 1031 Exchange Choose a qualified intermediary to coordinate the exchange. Sell your current real estate property. You have 45 days to identify potential replacement properties. You have 180 days to close on a replacement property. File IRS Form 8824.
In summary, 1031 exchanges in foreign countries can only be used if all properties involved (the relinquished property and the replacement property) are outside of the United States and its territories, and they should only be done in countries with no capital gains taxes.
Section 1031 is part of federal law, so it applies to federal taxes, which are the same no matter what state you're in. You can perform a 1031 exchange between business or investment properties located anywhere in the United States, so long as they meet all other 1031 requirements.
This means that you cannot perform a 1031 exchange between a U.S. property and a non-U.S. property. If your relinquished property is located within the United States, then your replacement property must also be located within the United States (or certain U.S. territories) to qualify for 1031 tax deferral.