YouTube's recommendations:
MPEG4 (Divx, Xvid) format
320x240 resolution
MP3 audio
30 frames per second
To achieve these settings, open your iMovie project. Go to file > export. Then select "quick time" and expert settings. Then you can change the settings to the ones listed above. 🙂