romantic or family entanglements, as mentioned, but also, as blac mentioned, by avoiding cookie-cutter characters. Blac mentiones holmes, if you have not read the stories, read a couple. The man was much more like Gregory House than like the character Basil Rathbone usually played, who was utterly stoic and victorian and politely reserved.
Other good examples would include pairings like Pacino/deNiro in "Heat", Magua the "bad" Indian in Last of the Mohicans, who lost so much he could only hate and lash out, but the scene where he explained his story, while an infodump, humanized him, etc.
add something personal to intertwine them....
as an example, I'm working on a story now where the "good guy" lost his wife. four "bad guys" beat him and one of them raped and killed the wife.
The "good guy" is out for revenge, along the way he is distancing himself from his closest friend and placing judgement, looking for the character he deems most unsavory to illegally buy a handgun from, knowing the police may come back and arrest a man he essentially entrapped. He does not care, this man can go to jail, if need be, despite having nothing to do with Pitta's death. He will kill the four men in cold blood, and he is slowly dehumanizing out of love and loss, two things we consider uniquely "human".
In contrast, of the four, one guy is pure malice, and all bad--he does border on cookier-cutter. His best friend is bright enough to realize the mistake they made and is considering going to the police to confess, reasoning that they deserve prison for their f'up. The other two are brothers, one is a carefree pothead who thinks what happened was "bad", but you need to roll with it, and going to prison won't bring back any dead girls, so better to simply shut up and ride things out. his brother is the most conflicted, the group's fifth wheel who watched even as part of him said to speak out, the most damaged by what they did, and slowly slipping towards suicide over it.
Everyone has personality and motivation, even the "man" bad buy was scorned and is a racist with a uniquely malicious streak. Good conflict comes from real, fleshed out characters, and real, fleshed out characters are rarely completely good or completely bad.