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 building 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 of Campus:
a. Personal Liberty: students living of campus generally enjoy more independence then 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 bg 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/)