Any idea what portion of first and second year students do research during the school year?
The beginning of first year is definitely a time to learn the basics of anatomy, physiology, and histology, in addition to getting comfortable in a new city and making tons of new friends. A few MSTPs who had productive research rotations during the summer before first year may continue their work into first year, but it's not the norm.
The last third of first year starts to provide you more and more free time, and since you've already spent months socializing, a number of people start their summer projects as early as February or March. That said, if you found something you wanted to work on throughout the entirety of first year, you'd definitely have the time to put in 10+ hours per week depending on how much you need to / want to study.
Second year is a different story. It's VERY busy with lots of class. You learn a TON and there are exams pretty frequently, so doing wet lab work is very rare except for people who probably don't care about their grades or simply have amazing projects that they would never put on the back burner. For the few people that take a full year of research between first and second year, these folks are more likely to continue working into second year in order to finish up their projects, not start something new. Given the added time commitment of dedicated Step 1 boards studying on top of regular classwork, you'll be pretty busy.
Also, since fourth year starts around mid-June, do students usually try to fit their (up to 3) research electives at the beginning, so that it's before residency apps?
For 4th year, people tend to put their strongest or most important rotations first, and sometimes that's research, other times not. Sub-I's in medicine are very popular and serve as a good way to get especially strong letters for residency, so often people do these early in fourth year. If you feel that extra research time will benefit your application the most, then you should do that early on, but I haven't heard of that being very common.
Instead, people usually put their research blocks during their residency interview months. For non-wet lab research, you can still be relatively productive while traveling for interviews. Having to tell your in-patient resident/attending team you'll be missing lots of time for interviews is not the easiest discussion to have.
That said, given how variably tiring or motivating/awesome third year can be, there's a wide range of sentiments regarding how busy one's fourth year should be. A common piece of advice given to fourth years on match day is to get as much sleep as possible between today and your first day of internship.