Here's how it happened:
1. Interstellar Cloud: The Sun began its life as part of a vast cloud of gas and dust in interstellar space. This cloud was mostly hydrogen and helium, but also contained trace amounts of heavier elements.
2. Gravity and Collapse: Over millions of years, gravity pulled the particles in the cloud closer together. As the cloud contracted, it began to rotate.
3. Protostar Formation: The core of the rotating cloud became increasingly dense and hot. Eventually, the core reached a critical temperature and pressure, triggering nuclear fusion. This marked the birth of the Sun as a protostar.
4. Planetary Disk Formation: The remaining material in the cloud, now orbiting the protostar, formed a disk. This disk eventually gave rise to the planets, moons, and other objects in our solar system.
In summary, the Sun did not form outside a rotating interstellar cloud; it formed within one. The rotation of the cloud played a crucial role in the Sun's formation, as it helped to concentrate the material that eventually became our star.