Hey dude...
In order to have a cleaner passage to the other note you will have to mute the string with your right hand when you are not playing it.
For example if I were to play something like this..
B --------12-14-15--------
G -12-14-15---------------
..you will need to find a way of keeping each other silent as you play on a separate string.
What you will do is that you have to standby your palm of your picking hand on the bridge to lightly mute the string. When you are playing the 12-14-15 at the G string you will use a portion of the flesh of your palm to mute down the B to prevent any noise. Once you are done with the G, you will then mute down the G and play the 12-14-15 on the B. Takes a while to nail it, but it will pay off 
Needless to say your whole palm which is already placed on the bridge will mute out any undesired notes from ringing out.
Oh yeah Malcolm_7, adding to what futures said, usually I don't play legato, but I do know that aside from muting properly, you will also need strength in your fingers to do precise hammer ons and pull offs.
What I can advise is that you can start training on trills, which are just rapid hammering on and pulling off on one string. Pull off as hard as you can, making the note being pulled off very prominent.
You can start building up your strength with something like this..
G -5h6p5---5h7p5---5h8p5--
This is basically a three finger trill exercise which I came out with 15 mins ago. Use your middle finger, ring finger and pinky finger to pull off the following notes respectively. It may seem tiring at first, but like workout at a gym there's bound to be results the next day or maybe later. When each note you have hammered on and pulled off are not so weak sounding you are most likely to be ready to try out a legato lick without much noise problems.
Hope I've helped as well. Cheers
GEAR:
Jackson RX10D Rhoads MIJ
Line 6 POD XT Live