When you have worked for a certain number of years, the company has not fired you.
The boss is willing to apply for a green card for you.
You said you had a chance.
Generally speaking, you can work legally in the United States.
It will take you five or six years to get a green card.