Sure, you can apply for any of these green cards while you are still a student.
Please go through my article in The Economic Times:
https://economictimes.indiatimes.com/nri/migrate/can-student-visa-holders-apply-for-a-green-card/articleshow/83976519.cms
NIW laws require only that you possess an advanced degree. A Master’s degree is an advanced degree.
---------------------------------------
Note: Unless the context shows otherwise, all answers here were provided by Rajiv and were compiled and reported by our editorial team from comments, blog and community calls on immigration.com. Where transcribed from audio/video, a verbatim transcript is provided. Therefore, it may not conform to the written grammatical or syntactical form.