According to Mormonism, all beings begin as eternal spirit intelligence’s awaiting spirit birth, including us. Well, once upon a time, one of these spirit intelligence’s underwent spirit birth to his god parents who ruled over their own planet(s), and he became known as ‘Elohim’ (in fact, his god parents too would have went through the same process as Elohim since, in Mormon cosmology, redemption and exaltation is an eternal cycle). Eventually, like all spirit children, Elohim was sent to take up a mortal body on his god’s own planet and worship his own god to attain redemption and exaltation. He was successful, and he and his wife were resurrected by their god father and then exalted to the status of godhood. Elohim could now create his own planets and have his own spirit children.
His first spirit child with his wife (known as the Heavenly Mother) is known as Jehovah, and his second spirit child is known as Lucifer, and of course every human who ever lived are his spirit children too including us. After Elohim and his family settled on the planet Kolob, Elohim commanded Jehovah to create earth, and so Jehovah organized the material necessary and formed the planet earth. Now, there was a war in heaven, because Lucifer wanted to be the redeemer of planet earth, yet Elohim and his council chose Jehovah to be the redeemer. Lucifer took 1/3 of the spirit children with him and they became the demons, that is, spirit children who would never attain mortal bodies. Another 1/3 who sided with Elohim and Jehovah would be able to attain mortal bodies on earth. A final 1/3, that is, the neutral ones, would also get mortal bodies but they would be cursed to have black skin while the ones who sided with Elohim would be blessed with white skin.
(Note: Elohim, Jehovah, and the Holy Spirit form the Mormon Godhead; that is, 3 gods who are united by one purpose in redeeming the earth. Elohim is the first god, Jehovah is the second god, and the Holy Spirit is the third god. Now, just to clarify, the Holy Spirit in Mormonism also seems to be a spirit child of Elohim, though he seems to have sacrificed attaining a mortal body in order to help Elohim and Jehovah in their plan of redeeming humanity.)