It would be best to take the community college course. With an online class, you have to take the AP Exam to get your college credit; with the CC course you get college credit off the bat (assuming you pass, of course). Colleges don’t have preferences for different courses, but I think it would be in your best interest to take it at a CC.