>>76325456 (OP)
Eat real food (rule of thumb: if you can't pick it from a tree/bush, grow it in your garden, or kill it for meat, then you don't need a lot of it).
Ideally, start by just counting everything you eat for a couple of weeks and sticking it in a calorie counting app, so you know what your starting calories are. There are also formulas online.
Start planning your diet with protein. Most current recommendations are around 0.7-1.0 grams per pound of bodyweight daily. Get a variety of sources.
You want at least 100g of carbs to avoid ketosis. You'll be better off adding more to accommodate activity.
Fats should probably be at least 40-50g, depending on how heavy you are.
Make sure you're eating fruits and vegetables.
Once you hit those minimums, it's a matter of filling in the rest of the calories in a way that's sustainable and effective for you. Personally, I like to fill with just more carbs, but some people do quite well on lower carbs and more fats. You'll probably have to experiment.
So in your case, I'd start at 100g protein, 45g fat, and however many grams of carbs gets you hitting your calorie number from the initial measurement/calculation. Taper your calories up slowly to build up your metabolism and start gaining weight without being miserable from eating too much. Try adding 50 calories to your diet once or twice per week, depending on hunger. At some point, adding more calories will have you gaining weight (not just water, actual tissue).
Train with weights. Your enjoyment of the program and your ability to work hard and progress while doing it matter more than the details of the program. There are lots that work. If you're not getting stronger, you probably aren't gaining muscle.
If you can do cardio regularly, do so. Fasted morning cardio most days will do wonders for you, just keep it gentle. Maybe a heart rate of 120-135 beats per minute.
wa la