The objects that we now see as comets and asteriods form in th solar system after solid particles condensed from the gas but before the planets finished forming. So the asteriods and comets form in the solar system that is the object that we see after the solid particles condensed from the gas but before the planet finished forming.