A decision like that depends upon a variety of factors. What I can help you with is making an informed decision so here are the advantages of both:Living on campus:
a. Accessibility: laboratories, gyms, libraries, etc are much more close to you.
b. Social Life: Students closer to campus can spend more time there which helps to build friendships and connections in some cases.
c. Security: Staying on campus with the provision of campus security, gives you a safer feeling than staying off-campus. Living off-Campus:
a. Personal Liberty: students living off-campus generally enjoy more independence than those on-campus.
b. Space and Privacy: for those living on campus having personal space becomes an issue as college dorms can become really noisy at times. This is a big advantage for those who like there own space.
c. Availability: staying off-campus means you're exposed to much more which helps a lot.
You could read more about it on this blog(https://ischoolconnect.com/blog/on-campus-vs-off-campus-what-should-international-students-choose/)