It helps if you have a varied range of techniques under your belt, that way if you ever think of something, you can get an idea of ways you can play it and where. But, for me, it helps to lay down some basic chords/rhythm progressions, and once I am content with the rhythm guitar, I'll add on riffs that are about an octave or two apart from the rhythm including sweeps and other lead parts. Other times, I'll just focus on 1 guitar which is more useful if you're the only guitarists in your band. You do a rhythm section that your vocalist can sing over, and you can throw little lead chunks in (over a chord progression of course), then once you get to the chorus, you can basically blow out all your lead ideas into there and see what works best. Once you reach the solo, I actually have no idea since I suck at writing solos.