I assume this was not your primary residence that you sold. If it was your primary residence and you owned and lived in it 2 out of the last 5 years (and a few other rules), you may be able to exclude up to $250,000 of gain if you are single or up to $500,000 of gain if you are married filing jointly. Please see below for more information on sale of a primary residence.
https://ttlc.intuit.com/replies/4241480
The gain is calculated by translating the purchase price using the exchange rate on the date of purchase, the cost of capital improvements using the exchange rate on the date the improvements were made and the exchange rate to USD on the date of the sale.
There is a secondary calculation if you had a foreign mortgage on the home you sold.
The Exchange Rate Gain from paying off a mortgage denominated in a foreign currency is treated as a separate transaction and is calculated by translating the amount of the loan using the exchange rate at the time the loan was originated and the exchange rate at the time the loan was paid off. The resulting “gain” is taxable as “ordinary income”
For more information on the sale of a primary residence, see below.