Here is a link where you can get the story:-
He was one of the sons of sage Bhrigu and his wife Khyati and thus the grandson of Lord Brahma. When they were young, Shukra and Brihaspati studied under the same guru, Sage Angirasa, who also happened to be Brihaspati's father. Shukra was known to be more knowledgeable than Brihaspati. Shukracharya became famous for his ability to resurrect people. He acquired this rare science from Lord Shiva, who was known as Conqueror of Death. The Devi-Bhagavata Purana refers to his mother as Kavyamata. The feminic natured Shukra is a Brahminical planet. He was born on Friday in the year Parthiva on Sraavana Suddha Ashtami when Svati Nakshatra is on the ascent. Hence, Friday is known as Shukravaaram in Indian languages like Sanskrit, Telugu, Hindi, Marathi, Gujarati, Oriya, Bengali, Assamese, and Kannada. He went on to study the Vedas under the rishi Angirasa but he was disturbed by Angirasa's favoritism for his son Brihaspati. He then went to study under rishi Gautama. He later performed penance to Lord Shiva and obtained the Sanjivani mantra. He married Priyavrata's daughter Urjjasvati and they had give sons — Chanda, Amarka, Ṣaṇḍa, Tvastr, Dharaatra and a daughter from his marriage to Indra's daughter Jayanti by the name Devayani. Amarka and Ṣaṇḍa were advisors to Hiranyakashipu.
During this period Brihaspati became the Guru of the Devas. Due to the hatred Sukracarya bore towards Vishnu for what he perceived as the murder of his mother as she had given shelter to some asura whom Vishnu was hunting, Shukracharya decided to become the Guru of Asuras. He helped them achieve victory over the Devas and used his knowledge to revive the dead and wounded among them.
- Quora answer by Abhimanyu Ray
sukracharya wanted to be the guru of devas, but lord vishnu appointed brihaspathi as guru of devas, and hence he was demoralize and accepted to be the guru of daitya and treated lord vishnu as one of his greatest enemy.
so he tried to defeat indralok many times with his cruel but great mind with the boon associated with him the SANJIVANI MANTRA which can give life to dead ones.
- Sukracharya - how he became guru of asuras (demons-rakshasas) and how he knew the art and science of Sanjivini?
4.How Shukracharya became the guru of the Asuras