If you are not a citizen, resident alien (substantial presence test) or permanent resident (green card holder) then you are not required to file a US tax return unless you have US-connected income. You would file form 1040-NR using Sprintax.
If you are a resident alien for 2022 (pass the substantial presence test, even though you moved partway through the year) then you file a US tax return form 1040 and report and pay tax on all your world-wide income. You may be able to claim a deduction or credit if you pay tax on the same income in another country.
https://www.irs.gov/individuals/international-taxpayers/substantial-presence-test
If you have left the US and are not coming back, you might be able to file as a dual status alien. That means you pay tax on all your worldwide income for the period of time you were a resident, but you only pay tax on US-connected income for the time after you left the country. This is a bit complicated and you may want professional assistance. Turbotax does not support this situation.
In most cases, the IRS will not make a deposit to an account that does not have your tax ID number on it, and if the IRS does attempt a deposit, most banks will reject the deposit if the name of the taxpayer does not match the name of the account holder. It's also a bad idea to use a friends account because if something goes wrong, you have no recourse with the IRS since they deposited the funds where you told them. You can get a check by mail, that you can deposit locally, or you may need to re-open a US bank account to receive a direct deposit of any refund.