OK there is what I think happened and I think I can prove it. I hope

Ok remember that in the rock lee flashback you saw him run away from school because he was getting teased. Then Gai was looking at him through a window with kakashi said to Gai that they seemed alike (or something like that). So then Gai when to see rock lee and found him training very hard.

I think what happened next is that Gai taught him instead of sending him back to school. He then never actually did the exam he was just given the genin after lots of had work. Gai might have explained the situation to Hokage and he was awarded the Genin status.

Ok so were the proof I promised...
Well remember that neji kept calling him a dropout. He also called naruto a dropout but there is a difference here. Naruto never really dropped out he just had to repeat the year where as we have an image of rock lee running away from school. Therefore, to conclude rock lee was a real dropout that never went back but then some years later was seen on neji's team. In addition, I believe this was deliberate because the Gai and the Hokage wanted to keep Gai as his sensei. We can also tell that Gai and lee spent a lot of time together because of their bond and also rock lee admires Gai so much so that he where the same outfit and dresses the same.

This could all be wrong but this is how I have always seen it while watching the show. You guys think I am close?