1- You need protein, carbohydrates and fat to gain weight and build muscle combined with your training regimen. It's not about going wild and eating everything, for muscle building you need high carb muscle building diet that has 25-30% protein, 25-35% fat and 40-60% carbohydrates.
2- When you are not training it's important to consume less calories.
3- Reduce or avoid taking junk and processed food.
4- Take post workout shake and supplement.
5- Since you need to add calories it's important to make it easy on you and know which food is best for adding calories, for example whole milk, Greek yogurt, nuts, peanut butter, bananas and stake with fat are good option.
6- Do not forget creatine. Creatine is known for its ability to increase muscle, it's probably the most researched and clinically proven in the market that is used by bodybuilders.
Building muscle is not only about training, it's training and nutrition. You need stamina and strength for your workout, and pre-workout supplement or nutrition should provide that. taking caffeine or something similar pre-workout will post your energy.BCAA’S also is also another ingredient that provide the muscle with energy and its absorbed easily by the body.