For gaining weight, you should develop the habit of eating more than your calories requirements (You should calculate your BMR and equate your calorie need). Plan your weekly diet with an intake of 3500 calories to gain 1 to 2 pounds a week. Make sure that you eat foods that are rich in proteins. Beef, chicken, milk, etc are very important. You should remember hat your meals contain plenty of vegetables too.
You have to follow a “weight gain and muscle mass building” routine. Your activities should make you gain weight without ending up obese.
clarianhealth.org