When created without sin, Satan was named Lucifer. We will use Lucifer in this answer.
Ezekiel 28:13-16 (CSB) – “You (Lucifer) were in Eden, the garden of God….You were an anointed guardian cherub, for I had appointed you. You were on the holy mountain of God…From the day you were created you were blameless in your ways…”
God put Lucifer in the Garden of Eden to watch over the first couple as a guardian. When Satan was given this honor, he was not yet expelled from God’s favor.
Specifically, Lucifer’s wickedness was pride. He wanted to have dominion and to be worshipped as a God. Isaiah 14:13-14 (CSB) – “You said to yourself, ‘I will ascend to the heavens; I will set up my throne above the stars of God. I will sit on the mount of the gods’ assembly, in the remotest parts of the North. I will ascend above the highest clouds; I will make myself like the Most High.’”
Thus, when Lucifer tempted Eve, he was trying to establish a human dominion. He presented himself as wiser and greater than God Almighty. He lied saying, “Did God really say, ‘You can't eat from any tree in the garden’?…No! You will not die,”…In fact, God knows that when you eat it your eyes will be opened and you will be like God, knowing good and evil.” Genesis 3:1,4,5 (CSB).
Even though Lucifer was doubtless prideful in his heart and may have conceived of this sin before he was placed in Eden, God did not punish him until he enticed Eve to sin. Ezekiel 28: 14, 16, “until wickedness was found in you…So I expelled you in disgrace from the mountain of God, and banished you, guardian cherub…”
Thus, when God punished the serpent (symbolizing Lucifer), He said, “Because you have done this… I will put hostility between you and the woman, and between your offspring and her offspring. He will strike your head (Satan will be destroyed at the end of the Little Season), and you will strike his heel (Jesus would be crucified). Genesis 3:14-15 (CSB). It seems reasonable that at this point, Satan was cast out of heaven.