Can I leave PhD after two years to join a company?
Can you quit a PhD? sure.
Can you stay in the US and take a job? probably not.
Unless you got into the US because of a family member or similar, your visa/status in the US is almost certainly tied to your PhD position. Unless your new employer is willing and able to sponsor you for a visa, quitting your PhD will likely mean having to leave the US.