In the very simplest terms, to build muscle you need to put your muscles under stress by lifting/pushing/pulling a challenging quantity of weight. By doing strength building exercises, you actually make microscopic tears in your muscle tissue... and then your body responds by rebuilding the muscle a little bit stronger so it's ready for the next time. As such, the 3 essential factors in building muscle are:
1) Weight/resistance. A good strength training exercise program should be reasonably challenging for you. It should also be easily modified to become progressively more challenging because, as you build more muscle, you'll need to amp up your workout to stress your muscles enough to stimulate muscle growth.
2) Nutrition. Obviously, if you're asking your body to create more muscle tissue, you need to give it the fuel it needs. There's a lot of opinions out there about what you should eat, how you should eat, when you should eat, etc... I'd just simplify it and say "eat." Eat the best quality food you can. Quality in = quality out.
3) Rest. Remember, muscles aren't built in the gym... they're built after your workout. It takes time for your body to rebuild muscle tissue, so strength training too frequently can interrupt that process and be counter-productive. A good rule-of-thumb is to work out 2-3 times a week if you do full body workouts, or up to 4 times a week if you do split (upper/lower) workouts.
Basically, any strength training program will build muscle... the best program is the program that is best FOR YOU. If you don't have a lot of equipment or want to join a gym, there are a ton of bodyweight exercises that you can do and they're easily modifiable to keep up with muscle growth. Here are some resources: www.niashanks.com/2012/07/bodyweight-worko
N.B. You will be REALLY sore a day or two after you start any new program. This is normal and is referred to as Delayed Onset Muscle Soreness or DOMS. There's nothing you can really do about DOMS except walk funny, take a hot bath, and ride it out... But it goes away and you don't typically experience it the next time you do those exercises, provided you don't take a really long break from working out. If your DOMS are really bad and you're too sore/stiff to workout with proper form, take another day off. Once you get over DOMS, it will be easier to maintain a 3 or 4 workout/per week schedule.