Population synthesis models of planetary systems developed during the last $sim$15 years could reproduce several of the observables of the exoplanet population, and also allowed to constrain planetary formation models. We present our planet formation model, which calculates the evolution of a planetary system during the gaseous phase. The code incorporates relevant physical phenomena for the formation of a planetary system, like photoevaporation, planet migration, gas accretion, water delivery in embryos and planetesimals, a detailed study of the orbital evolution of the planetesimal population, and the treatment of the fusion between embryos, considering their atmospheres. The main goal of this work, unlike other works of planetary population synthesis, is to find suitable scenarios and physical parameters of the disc to form solar system analogs. We are specially interested in the final planet distributions, and in the final surface density, eccentricity and inclination profiles for the planetesimal population. These final distributions will be used as initial conditions for N-body simulations, to study the post-oligarchic formation in a second work. We then consider different formation scenarios, with different planetesimal sizes and different type I migration rates. We find that solar system analogs are favored in massive discs, with low type I migration rates, and small planetesimal sizes. Besides, those rocky planets within their habitables zones are dry when discs dissipate. At last, the final configurations of solar system analogs include information about the mass and semimajor-axis of the planets, water contents, and the properties of the planetesimal remnants.