So, you want to make planets around an early sun? A very heavy sun, right? A sun which pulls very hard at all the matter around it, right? Virtually pulling everything to pieces, right?....right?
Ok, let's start with two masses. One very heavy, like a very early sun. Another, much smaller, like a very early planet. One might guess that there is some sort of limit in this system, a limit at which the very small proto-planet will be pulled into small pieces by the gravitational field of our early sun.
Indeed, such a limit excists and it is called the Roche Limit. Any object with a certain density, passing the heavy object with mass M at this perticular distance or closer will be shred to pieces. So, for any planet to be formed, it must be understood that there is a closest point of approach for any stadium in it's formation.
Here is the formal mathematical foundation for the Roche Limit.
Let's take a system as shown in the picture below.