Since the First Age, Sauron, formally known as "Mairon" was a maia and a craftsmen once under the wing of the Valar (Gods of Middle-Earth). Thou not as powerful as they, he was still one of the most powerful and most skilled maiar, even more so than Olorin and Curunir; better known as Gandalf and Saruman.
During that time, he was a good and uncorupt being. He had a unique trait for order and perfection, disliking anything to be wasteful. But it was in that desire, that Morgoth, the fallen Vala and first dark lord of Middle-Earth, lured him to being of his fathful servents.
Mairon, then called "Gorthaur the Cruel" had since become Morgoth's lieutenant to the kingdom of Angband. He once held a position as "Lord of Werewolves" in the island of Tol Sirion, then renamed Tol-in-Gaurhoth, the Isle of Werewolves. In a quest for the Silmarills, a maia-maiden Luthien with her wolfhound Huan confronted Gorthaur who transforms into a wolf himself to engage Huan, but the hound defeated him and fled back to his master in Angband.
When the Second Age came, and Morgoth had since been cast to the void by his fellow Valar, Sauron laid low for some time. But sure enough he reamerged and rose to power in his own domain in Mordor, where he would build his own fortress Barad-Dur near Mount Doom; and also lead his own army of Orcs, Trolls, and possibly other creatures, as well as men such as the Easterlings and Southrons of Harad.
Thou it was easy for Sauron to corrupt men, he sought to lure the elves into his service as they were more powerful. So he then took a more fair form, Annatar, the "Giver of Gifts" and befriended the elvish smithies for a time.
With their help, Sauron was able to forge the rings of power: Three for the elven kings, seven for the dwarf lords, and nine for mortal men. But little to their knowledge, Sauron back in Mordor crafted his own ring, the One Ring to rule them all. The elves sensed Sauron's treachery and the lords of the elves hide them to never be used or returned to him. Whatever happened to the dwarf rings was uncertain, but upon given the nine rings of power, the kings of men were then under Sauron's command and from then one they would become the Nazgul, Sauron's deadliest servents forever bound to his will.