What I should've done in freshmen/sophomore year if I want to transfer to CMU SCS?

Or any other schools with good cs program

You need to look at the transfer requirements for the universities which you are interested in. However, in general you want to take General Education requirements, Calculus I and II, science courses, humanities, and social sciences. Taking introductory computing courses will also be a good idea because once you transfer you will be expected to be taking more advanced CS courses. Look at the articulation agreements that your target schools have with local community colleges to see what kinds of things will transfer. Usually universities have this listed on their websites. My school, Illinois Tech has it for [local community colleges](Transfer Credit and Policies | Illinois Institute of Technology).