https://www.linkedin.com/pulse/us-companies-can-legally-hire-foreigners-living-other-rich-mba
As a general rule, wages earned by nonresident aliens for services performed outside of the United States for any employer are foreign source income and therefore are not subject to reporting and withholding of U.S. federal income tax.
"Non Residents"
“As a general rule, wages earned by nonresident aliens for services performed outside of the United States for any employer are foreign source income and therefore are not subject to reporting and withholding of U.S. federal income tax.”
This means that U.S. companies who hire foreigners living outside of the U.S. are not required to withhold the employee’s estimated taxes and do not have to report these wages to the IRS.
No W-2 or 1099 IRS forms!
“Question: If I am a Non-U.S. citizen but working for a U.S. company from my home abroad, do I have to pay U.S. taxes?
Answer: If your only income from the U.S. company is from compensation for services performed for that company, and you performed no services for the company while physically present in the U.S., you will not be subject to U.S. taxes on that income."
Also see IRS Publication 519, U.S. Tax Guide for Aliens.
It makes sense that the U.S. government is only concerned about protecting U.S. citizens in the job market from foreigners who will come to the U.S. to take their jobs.
However, nowhere in the U.S. Department of Labor’s rules and regulations do they state that it is illegal for U.S. companies to hire foreigners living in other countries who will remain in their countries.
No Social Security or Medicare Deductions
The IRS also states that foreigners who work for a U.S. company outside of the U.S. will not be subject to Social Security or Medicare deductions.
Here's what the IRS website says:
“In general, U.S. social security and Medicare taxes apply to payments of wages for services performed as an employee in the United States, regardless of the citizenship or residence of either the employee or the employer.”
Note: The words "in the United States" means the employee must be inside the U.S.
Therefore: No Social Security Tax or Medicare contributions by the employer or deductions from the foreign employee’s wages.
The Benefits of Hiring Freelance Foreigners Working in Other Countries include:
• The U.S. company saves time and money by not having to withhold estimated taxes, social security taxes, and Medicare from the employee’s salary.
• The U.S. employer saves money by not having to pay the Federal Insurance Contributions Act (FICA) contributions. These include U.S. Social Security Taxes (6.2%) and Medicare (1.45%). That’s a savings of 7.65% for the U.S. employer according to the current rates.
• The employer does not have to file reports with the IRS or Labor Department.