A lot of people starting out on guitar don't realize how much damage they're doing every time they launch into a song playing the same chords as the other guitar player. So, I want to explain the guitar player's golden rule: never play the same part as the other guitarist.
It doesn't matter if you can only play three chords. It doesn't matter if you're writing original songs with your band. It doesn't matter if you're a shit-hot lead player. If you want to get invited back to rehearsal or have the guitar passed around to you on the porch, you need to follow this simple rule.
Of course, in rock and roll rules are meant to be broken. But until you are Glen Branca or Keith Richards, compliance with this maxim will serve you well. Use it as an opportunity to make up a new part or hear the song in a new way.
When you're playing the same part as someone else, you're stepping into their frequency spectrum, the sonic equivalent of stepping on their toes. You're putting both guitars into the same EQ range, but they're not perfectly in sync, so it sounds like mud. It's like using too much salt in your food.
Each instrument in the band needs space to breathe. The combination of all of the instruments with their own space playing together in the pocket is what makes a band tight. Here are some examples:
The Iconic Four Piece
The Beatles are the template for how a guitar band should work: bass, drums, rhythm, and lead. Just watch their performance on the Ed Sullivan show. John is the prototypical rhythm guitarist and George stays out of his way, coming in with tasteful little lead lines whenever it serves the song.
The Power Trio
One way to do this is just not let a second guitar player in the band. The Who is perhaps the most iconic power trio, but there are many other great ones that came later, like Joy Division. The Ramones and Led Zeppelin weren't trios, but they were smart enough to only use one guitar player.
The Call and Response
Keith Richards basically invented this style by paying close attention to his drummer Charlie Watts and demanding that his second guitar player do the same. On a Stones song, it's hard to tell where the lead guitar ends and the rhythm guitar begins. If you're going to use two electric rhythm guitar players, this is how you do it.
Keith will often tune his guitar into an open G and use a capo to place it in a different voicing. Watch how Keith changes his playing on this jam session with Muddy Waters when Ron Wood gets up on stage, and Muddy just stops playing until it's his time to take a solo.
Another thing you can do is to try to make your guitar sound like another instrument. Duane Allman and Dickey Betts invented southern rock by harmonizing guitar lines to mimic horn parts.
A more contemporary example would be the way Jonny Greenwood runs his guitar through a myriad of effects. The guitar is basically a controller for his sonic laboratory.
The Grunge Acoustic
During the 90s a lot of bands started mixing acoustic guitars with thick distortion. The Weezer Blue album is a masterpiece example of this technique.
Wilco is another example, with Jeff Tweedy usually playing an acoustic guitar while Nels Cline plays a Jazzmaster.
Silence Is Always an Option
Music is simply notes (or rests) occuring in time. Always remember that not playing is a valid musical choice. Check your ego at the door and listen to how what you're doing affects the overall sound.