your 3u rank is how you are ranked against others who are taking the 3u course (this includes people doing 4u because they are also doing 3u).
your 2u rank is how you go compared with all the others doing 2u. (which is the 2u people + 3u people, but not 4 unit people as they are not doing the 2u course they only do the 3u and 4u course.)
3u rank comes from 3u marks.
2u rank comes from 2u marks.
(note i am talking about internal assessment marks and ranks)