pre-immigration tax planning: Receiving USD500K income in Jan 2024 before immigrating to the US in April 2024

Hello,

 

Here is my situation:

- I am not yet a US citizen. I have a valid tourist visa.

- I am married to a US citizen, and we currently live in the middle east. 

- I am planning to move with my wife to the US around April 2024. I will enter the US with my visit visa legally, and then start the change of status process to obtain my residency through my spouse. 

- I will receive around $500K lumpsum as an end-of-service benefit from my current employer (US company) to my bank account in the middle east in January 2024. 

 

My questions please:

- Will I be taxed on that amount in the US when I file for my taxes after I obtain my residency status, even though I received that amount BEFORE I became a US resident?

- If the answer to the previous question is yes, is there any pre-immigration planning I can do to not pay taxes on that amount given, once again, that this hard-earned money was for my 10 years of work before becoming a US resident? 

 

Thank you!