Actually I would like to start with the big bang theory which tells us the age of our universe and cosmos. Literally cosmos doesn't mean only the space around us but also the life present around us. So what big bang tells us is that the universe was a small atom which exploded and started to expand and contrast becoming the very known universe today. When the atom blasted the small particles got projected to the outer space which later formed stars and galaxies. But the most important question is what was there before the big bang? Was there another universe already? This is a puzzling question. As Stephen Hawking said our universe is still expanding and contrasting. By the way there are many other theories other than the big bang like the string theory or the dark matter theory which was told by the MIT that the universe is made up of dark matter it did not undergo big bang. But it is still under talks. Like this our galaxy and our solar system was formed. So our earth and its neighbouring planets was formed by the constant collision of the asteroids and then it formed a huge ball of stone which was hot and full of volcanoes and stuff. So why does our earth rotate? The answer is that when the asteroids came together they were rotating in high speed which due to law of inertia it still rotates now. After millions of years of cooling and condensing our earth was formed.