Being cool. Seriously. I have a classmate here at my hospital in a different specialty that everyone loves to work with. He's fun, witty, and enjoyable to work with. In medical school he routinely cruised in the bottom 10%. But he passed, and now nurses bend over backwards to help him take care of his patients. Luckily, I was smart enough in med school to spend nearly as much time on the golf course with him as I did studying. Trust me, no one knows and no one cares that I outscored him on the boards by nearly 90 pts.
Other things that matter are specialty dependent, but include:
1) Rotation grade in specialty you are entering
2) Letters of recommendation
3) Board scores
5) 3rd year grades
If you are wise, you'll study to learn medicine, and not to pass a test, and the rest will fall into place. Don't worry about the first two years, just learn as much as you can. If its important, you'll see it again.