The solar system started be gas between helium and hydrogen also dust. Gravity pulled this dust cloud closer and closer. Clumps began to form, it spun.