To successfully gain weight you have to count calories the same way a slimmer would do. Assuming you're averagely active you're aiming for about 2700-3000 calories per day, every day, to start with. If you gain about 1 - 2lbs each week, that's the right level. If you don't gain, add another 500 cals to your daily target and try again.
Aim to eat 'little and often' planning high-calorie, low-bulk snacks and meals - something every 2 hours. Base meals around fats and carbohydrates, avoid too many low-cal, high-bulk things like vegetables and always have plenty of things like nuts and dried fruit to make up any shortfall. High-calorie drinks help a lot. Choose full-fat milk and fresh juices over water, for example.
To help turn the extra calories into lean muscle rather than fat, choose exercises designed to strengthen and tone. Resistance and weights. Avoid aerobic, calorie-burning exercise like running.