Paying for Personal college with 401k

Am an international student who got internships in US and am in final year of college.
Realized I can withdraw 401k (which I’ve been contributing to in my internships) without penalty.

I haven’t been maxing my 401k for internships, but now realize that if I don’t pay taxes on the contributions and use that to pay for school, it actually makes a lot of sense.

How do I go about it? Do I qualify even if my 401k is just opened less than one year. Thanks!