Lucifer was among the morning stars who lived in the presence of God the Father and his son Jesus Christ. He saw the glory of the Father and desired to be like him along with all the other spirit children of the Father. When the Father presented a plan for all of us to become more like the Father by coming to a fallen world, having our memory of our premortal existence removed, and maintaining our free will to choose good over evil. When Lucifer heard the plan of the Father, he thought to device his own plan which included taking away the free will of mankind. He presented his plan before the Father but the Father rejected his plan. This made Lucifer angry. He felt that his plan was better and sought to usurp the authority of God by starting a war in heaven by trying to lead away other children of God from following God's plan The Father rejected Lucifer's plan because it was important that for man to progress and become more like the Father, they need to choose to be good beings of their own free will and volition. Thus without free will it could not bring about the progression of mankind to become a good being in and of themselves by using their own free will to choose good over evil. Lucifer was very successful and got one third of all the hosts of heaven to follow his plan. After doing this, God cast Satan and his followers out of heaven and they became Satan and his demons. We read about this war in heaven in the Book of Revelation:
Revelation 12:7-11
7 And there was war in heaven: Michael and his angels fought against the dragon; and the dragon fought and his angels,
8 And prevailed not; neither was their place found any more in heaven.
9 And the great dragon was cast out, that old serpent, called the Devil, and Satan, which deceiveth the whole world: he was cast out into the earth, and his angels were cast out with him.
10 And I heard a loud voice saying in heaven, Now is come salvation, and strength, and the kingdom of our God, and the power of his Christ: for the accuser of our brethren is cast down, which accused them before our God day and night.
11 And they overcame him by the blood of the Lamb, and by the word of their testimony; and they loved not their lives unto the death.
Isaiah also mentions the fall of Lucifer from heaven:
Isaiah 14:12-17
12 How art thou fallen from heaven, O Lucifer, son of the morning! how art thou cut down to the ground, which didst weaken the nations!
13 For thou hast said in thine heart, I will ascend into heaven, I will exalt my throne above the stars of God: I will sit also upon the mount of the congregation, in the sides of the north:
14 I will ascend above the heights of the clouds; I will be like the most High.
15 Yet thou shalt be brought down to hell, to the sides of the pit.
16 They that see thee shall narrowly look upon thee, and consider thee, saying, Is this the man that made the earth to tremble, that did shake kingdoms;
17 That made the world as a wilderness, and destroyed the cities thereof; that opened not the house of his prisoners?
Other latter-day verses speak of this conflict that occurred in heaven also:
Doctrine and Covenants 76:25-49
25 And this we saw also, and bear record, that an angel of God who was in authority in the presence of God, who rebelled against the Only Begotten Son whom the Father loved and who was in the bosom of the Father, was thrust down from the presence of God and the Son,
26 And was called Perdition, for the heavens wept over him—he was Lucifer, a son of the morning.
27 And we beheld, and lo, he is fallen! is fallen, even a son of the morning!
28 And while we were yet in the Spirit, the Lord commanded us that we should write the vision; for we beheld Satan, that old serpent, even the devil, who rebelled against God, and sought to take the kingdom of our God and his Christ—
29 Wherefore, he maketh war with the saints of God, and encompasseth them round about.
30 And we saw a vision of the sufferings of those with whom he made war and overcame, for thus came the voice of the Lord unto us:
31 Thus saith the Lord concerning all those who know my power, and have been made partakers thereof, and suffered themselves through the power of the devil to be overcome, and to deny the truth and defy my power—
32 They are they who are the sons of perdition, of whom I say that it had been better for them never to have been born;
33 For they are vessels of wrath, doomed to suffer the wrath of God, with the devil and his angels in eternity;
34 Concerning whom I have said there is no forgiveness in this world nor in the world to come—
35 Having denied the Holy Spirit after having received it, and having denied the Only Begotten Son of the Father, having crucified him unto themselves and put him to an open shame.
36 These are they who shall go away into the lake of fire and brimstone, with the devil and his angels—
37 And the only ones on whom the second death shall have any power;
38 Yea, verily, the only ones who shall not be redeemed in the due time of the Lord, after the sufferings of his wrath.
39 For all the rest shall be brought forth by the resurrection of the dead, through the triumph and the glory of the Lamb, who was slain, who was in the bosom of the Father before the worlds were made.
40 And this is the gospel, the glad tidings, which the voice out of the heavens bore record unto us—
41 That he came into the world, even Jesus, to be crucified for the world, and to bear the sins of the world, and to sanctify the world, and to cleanse it from all unrighteousness;
42 That through him all might be saved whom the Father had put into his power and made by him;
43 Who glorifies the Father, and saves all the works of his hands, except those sons of perdition who deny the Son after the Father has revealed him.
44 Wherefore, he saves all except them—they shall go away into everlasting punishment, which is endless punishment, which is eternal punishment, to reign with the devil and his angels in eternity, where their worm dieth not, and the fire is not quenched, which is their torment—
45 And the end thereof, neither the place thereof, nor their torment, no man knows;
46 Neither was it revealed, neither is, neither will be revealed unto man, except to them who are made partakers thereof;
47 Nevertheless, I, the Lord, show it by vision unto many, but straightway shut it up again;
48 Wherefore, the end, the width, the height, the depth, and the misery thereof, they understand not, neither any man except those who are ordained unto this condemnation.
49 And we heard the voice, saying: Write the vision, for lo, this is the end of the vision of the sufferings of the ungodly.
Moses 4:1-4
1 And I, the Lord God, spake unto Moses, saying: That Satan, whom thou hast commanded in the name of mine Only Begotten, is the same which was from the beginning, and he came before me, saying—Behold, here am I, send me, I will be thy son, and I will redeem all mankind, that one soul shall not be lost, and surely I will do it; wherefore give me thine honor.
2 But, behold, my Beloved Son, which was my Beloved and Chosen from the beginning, said unto me—Father, thy will be done, and the glory be thine forever.
3 Wherefore, because that Satan rebelled against me, and sought to destroy the agency of man, which I, the Lord God, had given him, and also, that I should give unto him mine own power; by the power of mine Only Begotten, I caused that he should be cast down;
4 And he became Satan, yea, even the devil, the father of all lies, to deceive and to blind men, and to lead them captive at his will, even as many as would not hearken unto my voice.
The war that began in heaven continues still upon the earth. Satan lost the war in heaven but now hopes to cause all those of us who sided with God to lose our salvation into the kingdom of heaven and if he can he wishes to make us all sons of perdition. Thus it is incumbent upon us to truly learn and know the will of God and to understand it so that we are not deceived by that wicked one. God has ensured our free will and so it is up to us to choose good over evil in this life and salvation over damnation.