Yes, I think he had second amendment rights as a legal visitor to this country. In my view, the second amendment doesn't give us rights, it codifies natural rights and limits the government's ability to restrict or take away. Anyone considering the Bill of Rights as something the government has given them is missing the point and accepting the government as their master rather than their servant.
This fellow is facing deportation not because he bought a gun, but because he failed to meet the requirements of his visa by not attending classes. The "sniper rifle" comments and change in behaviors accelerated the process.