"Also note that for the physicsl presence test you'd not have to use the exact tax year. Any 12 month period can be used."
Any 12 month period starting when? In 2020 and 2021 I didn't go to the US at all, But I was there for 30 consecutive days in 2022, and in 2023 I was there for 30 days from mid April to mid May, and 15 more days in August.
I've been working in Thailand and staying on a non-immigrant B visa. In the past, I've always submitted Form 2555 with the 1040 as you mentioned, but in 2023 I was in the US for 45 days.
Yes, I need to submit a substitute W2 form. I will read the link you sent. Thank you