
Quoting
Karin Wolman
There is one important carve-out for foreign students and exchange visitors present in the United States under F, J or Q nonimmigrant visa status. These nonimmigrants, including their spouses and children in a dependent visa classification, are permitted to exclude from their U.S. gross income any pay received from a foreign employer. This group includes a wide assortment of students, scholars, trainees, interns, teachers, professors, researchers and research assistants, or leaders in a field of specialized knowledge or skill. F, J & Q nonimmigrants and their dependents may work from home for a foreign employer, and are not considered to have earned any US source income by doing so.