Visas and visa waivers are issued by the US Federal (national) government, while company formation is handled by the US states.
Montana doesn’t require US citizenship, residency, or even presence in the United States to form a Montana limited liability company (LLC).
If you’re on a B1, B2, ESTA, or other non-working visa (or visa waiver), you are prohibited from being employed in the United States while you’re here.
The relationship between yourself and your LLC is one of ownership, not of employment.
However, using your LLC for commercial purposes while you’re in the US - i.e., regularly selling goods and/or services - may cause authorities to consider your relationship to your LLC as one of employment. If you have any questions about employment while in the United States, please consult an immigration attorney.