In order to join the US Military, you must either be a US citizen, or you must be a legal permanent immigrant, physically living in the United States, with a green card. The US military cannot and will not assist with the immigration process.
If you are not a US citizen, you must legally and permanently immigrate to the United States first, via the regular immigration procedures and quotas, establish a residence, and then (if you meet the other qualifying criteria), visit a military recruiter's office and apply for enlistment.
For enlistment purposes, citizens of the United States include citizens of Guam, Puerto Rico, The U.S. Virgin Islands, The Northern Marianas Islands, American Samoa, The Federated States of Micronesia, and The Republic of the Marshall Islands are eligible to enlist in the military.
Not all legal immigrants are eligible to enlist. Applicants who have been residents of countries considered hostile to the interests of the United States require a waiver. See your local recruiter for the most current list of countries considered hostile to the interests of the United States. Typically, Russia, Iran, North Korea, China are the leading countries on the list, but there are others as well.
While non-citizens may enlist, they will find their job choices extremely limited. DOD policy prohibits granting security clearances to non-U.S. Citizens. Therefore, non-Citizens. who enlist in the United States military will be limited to those jobs which do not require a security clearance.
For instance, many immigrants who wish to become Intelligence Specialists or a member of the military's special operations (SEAL, Special Forces, etc) cannot attend the advanced training until their citizenship has been approved. This may take a few years while serving in another role open to immigrants. In order to join the U.S. military as a non-citizen, you must be currently living permanently (and legally) in the United States. Tourist visas and student visas aren't good enough.
More Information on the Green Card
To be categorized as a "legal permanent immigrant," with permission to work in the United States means you must have an I–551 (Permanent Residence Card, aka Green Card). Applicants with expired cards keep their permanent residence status; however, they must apply for renewal of their permanent residence status Green Card and must obtain verification in the form of an original receipt from the U.S. Citizenship and Immigration Services (USCIS) indicating that the applicant has paid for an I–90 (Application to Replace Permanent Resident) renewal application prior to enlistment.
Applicant must have a valid I–551 Card prior to shipment to training. A Green Card that expires within six months of joining must be renewed and be valid for at least six months after the applicant’s enlistment date. It is still possible to enlist, serve the United States, and still not be granted citizenship, but many legal immigrants who serve do find the process quicker and become United States citizens while serving their "new" country. See the USCIS link for greater details on how to become a legal United States immigrant and later become a citizen/resident. But the basics are the following:
Typically, the application process to obtain a Green Card requires an applicant to have a family, employment, getting married to a United States citizen, or refugee status. However, there are many other ways you can become eligible for legal immigrant status.
But to join the military, you must immigrate first, using the normal immigration procedures above, and then after immigration is complete you can apply to enlist in any branch of the U.S. Military by visiting the nearest Military recruiting office. Non-citizens cannot become officers, however. For legal immigrants who do enlist, there are accelerated citizenship procedures for non-citizens on active duty. For details, see our article, Becoming a Citizen in the US Military.