If you are a non-resident alien you owe on every cent of US sourced income during your stay. If you are here > 186 days you are a resident alien and owe on every cent of worldwide income. It’s as simple as that. Your greencard will get declined if you are not up to date with the IRS.
On a slight tangent… Being an american citizen puts you in a really bad position if you ever wanted to emigrate as you owe the IRS for every cent you earn worldwide no matter where you decide to live. This is pretty much the only nation in the world that has its claws that deep into its people’s pocketbooks. There really is no escape.