To gain weight you need to be in a calorie surplus. Track what you eat with MyFitnessPal and calculate your maintenance calories using an online calculator. Then try eating calorie dense food such as peanut butter. Drinkable calories will also help. However, don’t just eat whatever you want, try to eat just 200-300 calories above maintenance otherwise you’ll gain too much fat.