Second, gaining weight is not a BAD thing, especially if you want to gain muscle mass. And you WILL gain weight and you WILL be heavier, as muscle weighs weight. Gaining weight is NOT counterproductive, and if you do NOT want to gain any, then bodybuilding may not be for you, as even if you lost fat and gained muscle you could still be heavier, as muscle weighs more than fat.
Third, if you want to gain muscle then gaining fat comes with it. However, you can successfully gain muscle mass with MINIMAL fat gain; this IS a long and slow process, though and requires perfect manipulation of your diet and training targeted at recomping.
I recommend that you get yourself a fitness management consultant/personal trainer, who knows their stuff, who will write you an individualized plan re nutrition and diet for your goals.