First two years of medical school are in classroom, second two years are clinical rotations.
Residency is after medical school, and that's the first time you start earning a meager paycheck. In medical school, even when you're "working" with patients, you still pay tuition.