I would say that, since your final
goal is muscle gain, to not worry too much about the
fat at this point. If you worry more about the muscles, the
fat will solve itself
Now, the community around here isn't as focussed on muscle gain as it is
fat loss, but I believe
fitness.com hosts another forum for muscle building that you may want to check out. But I'll give advice a shot anyways because I'd hate to see a post wasted
A very important thing for you to look at is WHAT your eating, and HOW you're eating it. The fact that you gained
fat when you were trying to gain muscles tells me you may not be well educated on
nutrition. I would suggest seeing if your school has any sort of "healthy life" programs that might employ a nutritionist for indepth suggestions, but in general, you DON'T want to be eating items high in
fat (especially saturated
fat!), and you DO want to be eating items high in protein for muscle building. Eating things that have lean white meat would be best, like the white meat from chicken and turkeys, fish, pork (fat cut off), etc. Nuts are also good since the
fat they contain is a "good"
fat, but be careful with nuts because they're pretty dense with the
calories so its very easy to overeat on them.
Of course, if you're trying to build muscle, you'll want to work them out hard! The general rule I've heard is that lower resistance (weight) and more reps will give more lean muscle, and higher resistance with fewer reps will give more of the bulky muscles - but either will give at least a little of both muscle types (again, check with a pro rather than taking some random chumps word for gospel

)
I'd also like to echo Mal's words: please check with parents, doctor, etc before starting anything to rigourous - we'd hate to have your hurt yourself unintentionally have nobody know why!