Should I do Master or PhD to teach in community college?
A large portion of the community college workforce is part-time.  When there are full time job openings, they are quite competitive.  I will assume you are looking for full time work.  I have observed that many community college job advertisements say that a PhD is desirable, and I think that the applicant pool will typically contain many PhDs.  So I would suggest getting a PhD.

Be sure that during your PhD, you demonstrate that you know how to teach.  You can find quite a bit of information about how to obtain a job at a community college in columns on Inside Higher Ed.  If you earn a masters in the course of earning your PhD, teaching part-time at a community college during your PhD could be a good strategy.