Muawiyiah belonged to the Umayyad section of the Quraish of Makkah. Muawiyah and the Holy Prophet had Abd Manaf as their common ancestor. The Holy Prophet was the son of Abdullah who was the son of Abdul Muttalib, who was the son of Hashim who was the son of Abd Manaf. Muawiyah was the son of Abu Sufiyan, who was the son of Harb, who was the son of Umayyah, who was the son of Abd Shams, who was the son Abd Manaf. Hashim and Abd Shams were the two sons of Abd Manaf. The Holy Prophet was a descendant of Hashim while Muawiyah was a descendant of Abd Shams. Umayyah the son of Abd Shams was an important man of the line, and his descendants came to be known after him as the Umayyads.
Abu Sufiyan the father of Muawiyah was a Quraish magnate. When the Holy Prophet declared his mission, Abu Sufiyan was conspicuous for his hostility to the Holy Prophet and Islam. He led the Quraish army against the Muslims in the battles of Uhud and the Trench. Muawiyah's mother was the atrocious woman who made necklaces and bracelets of the ears and noses of the Muslims slain at Uhud. She ripped the dead body of Hamza, an uncle of the Holy Prophet, martyred at Uhud, took out the liver and put her teeth in it.
It was only after the conquest of Makkah by the Muslims that Abu Sufiyan and his family including Muawiyah submitted to Islam. After conversion to Islam, Muawiyah acted for some time as a Secretary to the Holy Prophet. During the caliphate of Abu Bakr and Umar, Muawiyah and his elder brother Abu Yazid fought against the Byzantines in Syria.
Umar appointed Abu Ubaida b Jarrah as the Governor of Syria. On the death of Abu Ubaida, Abu Yazid the brother of Muawiyah was appointed as the Governor of Syria. On the death of Abu Yazid, Umar appointed Muawiyah as the Governor of Syria. When Othman who was a cousin of Muawiyah became the Caliph, he confirmed Muawiyah in his appointment as the Governor of Syria, and added some other territories to his jurisdiction.