Capital Gains after moving overseas

Hi all,

 

I know this is not official advice but I am hoping someone can point me in the right direction. I made a Capital Gain on stocks I bought in 2020 and then sold in March 2022. I then panicked and re-bought a few days later since the shares were still going up and the predictions were positive. A few days later everything started crashing, instead of selling I held. I have now made a significant capital loss. 

 

So my situation is complex: I was in the US working under a visa until 01.31.22 - I got 1 month salary in 2022, I am not a Citizen, nor a GC holder so I am no longer associated with the US. I am now working overseas as of Feb 22, I sold the shares in March after leaving the US.

 

From my understanding because of this situation I do not have to pay tax on the Capital Gains. Knowing that I will get a 1099, will Turbo Tax be able to handle this situation and remove the taxes owed?

 

Thank you