As far as the IRS goes, here's probably what you need to know: https://www.irs.gov/individuals/inte...come-exclusion
We can't answer your question directly with the information above (we need to know how long, who you are working for, etc...).

If you intend to reside outside of the US, you need to take steps to avoid having the US consider you to have abandoned your permanent residency.