Why do rocky planets form? When a star system forms from a cloud of gas and dust, why doesn't the dust migrate towards the centre of gravity with the gas to form a star? Why does dust in the accretion disk aggregate to form rocky planets, rather than fall into the proto-star?
The nebula from which the sun and the solar system formed contained mostly hydrogen and helium, but also small amounts of heavier elements, including "dust". 

Any dust that ended up in the centre of the accretion disc became part of the sun. The sun contains 0.01% silicon, for example. This is only a small proportion, but is still about $2\times10^{26}kg$, 100 times the mass of the Earth. When you add in the Iron, Nickel, Oxygen, Carbon and other elements that make up the rocks, you find that there is enough matter in the sun to make up thousands of rocky planets. (http://www.space.com/17170-what-is-the-sun-made-of.html)

So it is only that part of the dust that happens not to fall into the sun that goes on to form rocky planets.

The details of the process of planetary formation are complex (and not completely understood) however after the formation of the sun, solar wind cleared out the inner solar system of gas and volatiles, leaving only the rocky planets which were too small to hold on a large hydrogen-helium envelope. Further out, beyond the ice-line, water and other volatiles are solid, and much larger planets can form, that gravitationally attract hydrogen and helium mantles.

see How did the Earth come to be in orbit around the sun? for more on planetary formation.