Like with any other body part legs need to be trained equally. For example, if you always train the front of your arms and not the back, you could end up with wobbly arms when you wave!
The legs are no different. They are made up of several groups of muscles including the hamstrings, calves, quads, adductors, abductors and GLUTES! They must all play a part in the training programme to help make them look and feel great. Sure, on some days you could focus more heavily on either quads or hamstrings/glutes but, in a full training week, all of the muscle groups should be trained for maximum impact and benefit.
To build muscle you must go through fatigue, so picking a repetition range to help build muscle (around 8-12 per set) and 3-6 sets will get you on the way to having longer leaner legs.
Including variations of lifting exercises (deadlift, sumo deadlift, stiff leg deadlift) will tend to focus on the back of the leg muscles while variations of squat exercises tend to develop the quads (back squat, front squat, wide squat, goblet squat).
Lunges are a great all rounder! They help to develop the whole leg, and there are literally hundreds of lunge variations to choose from including forward, reverse, side, narrow stance, jump, drop lunges…… and many more!!!
I, personally, like to incorporate some power exercises like burpees, box jumps or kettlebell swings at the end of a leg workout to give your legs an extra challenge!