Welcome to Physics Forums, dedaNoe!
As described above, the solar system formed from a diffuse cloud of material (a nebula). As gravity pulled this asymmetrical cloud together, it has a slight spin. Like an ice skater pulling in his/her arms to spin faster, the nebula material spun faster as it became more compacted. The largest mass of material in the center became the sun and the mass further out became the planets, asteroids, comets, etc. You can see that so far everything is spinning the same way.
With a faster spin, there is more of a "force" to throw matter outward perpendicular to the axis of spin. (Think of yourself on a spinning carnival ride.) So, the combination of gravity pulling matter inward and the spin flinging matter outward caused the material to flatten out into a disk shape. This is why the planets orbit more or less in the same plane and is also why some galaxies (like our own Milky Way) are disk-like. The spare material in the outer part of the disk was swept up by the planets so now the solar system is mostly empty. There are still some leftover building blocks...i.e., the asteroids and comets.
The sweeping up of material is not always a calm experience, but instead can be planet-shattering collisions. Astronomers believe that a Mars-sized planetoid smacked into the Earth about 4 to 4.5 billion years ago and resulted in the formation of the Moon (all the material that was thrown off the Earth and probably the other impactor).
The planets Venus and Uranus rotate on their axis differently than the other planets, perhaps due to similar ancient collisions that tumbled their original axis of rotation (that used to be like the other planets') in a new direction. Venus rotates in the opposite direction. Uranus rotates on its side.
Atoms are a very different thing. In the past, it was often taught that the solar system was a good analogy for electrons orbiting the atomic nucleus. But now that analogy is not too useful except for a very, very basic understanding of electron valence states. Perhaps you could start a new topic in the physics forum about a better, modern analogy.