As a teacher of high school seniors, I assure you that two years of the same language is a "standard" requirement for admissions at most 4-year universities (and has been since I was a college student in the 80s). No exclusion policies. It's an admissions requirement for everyone.
If the world language (we don't say foreign language anymore) is the only thing preventing you from being admitted to a certain school, a state school will still turn you down, BUT a small, non-elite private school may allow you "in" without the language . . . but you'll be required to take it during your first year of college, and it will be considered "remedial" -- that is, you will have to pay for it, but it won't count for college credit. This is, obviously, a bad deal. Take the classes in high school.
If you're looking at a community college, you don't need the two years of world language, BUT if you ever want to transfer to a 4-year university, it will be required at that point.
As for taking it online, tread carefully. Online classes are growing in popularity, and I've had some students take world languages online with success . . . but I've had more say they wished they'd never embarked on that quest. As a rule, I'd be more willing to say, "Do it!" to a student who'd already had the first level class and was looking to take the second or third level -- it's tough to get the rudimentary punctuation without help from an actual, in-person teacher. An alternative: If you can't fit in the language class, consider taking, perhaps, history online and take the language class in person.
Do you need to take world language at the college level to earn your college degree? That depends upon your major and your school. My nursing daughter doesn't have to take it, but my business daughter will.