Hi!
You’ll probably hear this a lot around these forums, but I highly encourage you to listen to Dr. Gray’s podcasts for useful information about the med admissions process. I’ve personally found Ask Dr. Gray: Premed Q&A and the Old Premeds Podcast really helpful. For your question, I’d recommend Ask Dr. Gray: Premed Q&A, episode 121 - “How Do Med Schools View Community College Classes?”
Beyond that there are two things to consider with university versus community college. First, (and most importantly) find a school where you can become actively involved in your learning. These courses will be included on your application and they will impact your cGPA. Having said that, med schools can see every data point and (according to Dr. Gray) care more about your trend than the average. Brief side note, smaller class sizes also provide more interaction with professors, which could lead to a strong Letter of Recommendation for your application.
Secondly, make sure to consider the “why” behind your choice. Med schools can sometimes be a bit prejudiced against community colleges, but it is much easier to explain (and much less of a red flag) if you have a reason prepared for why you selected community college (e.g. finances, schedule). What you do NOT want to do is have a pattern of taking courses at university, failing, and then retaking those courses at community college (see point #1).
Ultimately, you should choose a school where you can succeed and that fits you. Crafting your journey around your interests in medicine not only makes it easier to tell your story, but it makes the journey more enjoyable and less of a tedious list of to-dos. You are the unique factor in your application.
Good luck!