It will depend on how long you have been training and how strong you are if you want to gain muscle. Every weight-trainer will tell you that a big muscle is a strong muscle so your objective is to increase your strength because that will add muscle to your frame.
If you have never trained with weights before and about to start then you should know that the first year of training that you do will gain you more muscle than any year thereafter. It makes sense because the muscles respond to the increase in weight that you lift by growing bigger.
If your primary objective is to gain muscle you are going to have to stick to the 'Big Four' which are the basic compound movements that you need to do in order to increase your core strength that you have. These are squats, deadlift, bench-press and military press.
All these movements should be done in the 6 to 12 rep range so that you are always reaching the point of failure on the last rep of the last set. If you have been training for more than a year you could go down as far as 2 to 4 reps or do 5 X 5 training but you need to be careful when training so heavy to make sure that you have perfect form in order to always avoid getting injured.
But training correctly is only part of solution if you want to gain muscle mass. Your hard workouts will be useless if you are not eating correctly and you will be wasting your time on your hard training and just land up losing muscle as you over-train if you do not eat right.
The bottom line on eating correctly to gain muscle is carbs, protein and fat and how often you get that into your system. Your body is constantly trying to repair the damage that you have done at the gym and that means that it needs all the nutrients that it requires exactly when it needs them or else you will be over-trained.
This is why you need to stop only eating 3 times a day and start eating 6 or even 7 times a day. It is the combination of complex carbs like brown rice, whole-wheat pasta or bread, oatmeal, beans, potatoes, yams and plenty of fruit. Your protein will come from good quality sources like chicken, tuna, lean beef, cottage cheese, whey protein, eggs and nuts.
The last macronutrient that you simply cannot do without is fat, without which you will not produce any testosterone and not build muscle. Good quality fat comes from peanut butter, almonds, walnuts, flax seed oil, olive and fish oil. You also need to drink plenty of water and get plenty of rest with at least 8 hours sleep a night.