Yes, that’s right, you would pay tax on any profit element but if same or less it would be no tax due
The title company withhold 15% of sale proceeds and then ask you to get a ITIN number from IRS (you can do this earlier in the selling process) and they prepare a withholding certificate
To get ITIN you will need to get signed copies or original documents to IRS, we got our passports signed at US Embassy in Edinburgh
The certificate from title co goes off to IRS to agree, this process is taking 12+ months, could be more if IRS have less staff now
We have had no update since selling a contract last June
You could ask a broker about this in advance, lots of videos on
YouTube about it too