Best exercise for weight/mass gain?

Hads

I don’t like how underweight I am. I am trying to gain weight with my diet, but I am not sure on which exercise that also involves weights would be most effective for someone who is trying to put on some muscle? I’d love to have bigger legs!