Eat more. Seriously, it's that simple.
Basic paleo will help you shed excess weight (fat), leaning out and feel better. I assume when you say "weight gain" you want to gain more muscle mass, not become obese, right?
So load up! Double your protein, double your fats, include lots of healthy carbs like sweet potatoes. Go nuts
Put butter and coconut oil on everything. Eat a dozen eggs for breakfast every morning. Have a pound of bacon in a sitting. Eat 4 sweet potatoes for dessert. Shovel that steak down. Always have almonds in your hands. You need to feel stuffed all the time.
And don't forget to lift heavy