  Understanding the formation history of planets is one of the goals of
studying exoplanet atmospheres. The atmospheric composition of planets can
provide insights into the formation pathways of planets. Even though the
mapping of the atmospheric composition onto a formation pathway is not
unambiguous, with the increasing sensitivity of modern instruments, we can
derive promising constraints. In this work, we aim to understand the formation
pathway of WASP-39b. We discuss whether the detection of SO2 in its atmosphere
would impact our understanding of the formation of the planet and whether it
enables us to determine the formation pathway of the planet with greater
accuracy. We used the JWST transit observation of the planet together with the
available HST and Spitzer observations. We used a formation model coupled with
a radiative transfer retrieval model to derive the planet's atmospheric
characteristics and formation history. Furthermore, we used a photochemical
model to derive the impact of photochemistry on the atmosphere of the planet.
In this work, we show that the planet is most likely to have initiated beyond
the CO2 ice line of its natal disk. Furthermore, the planet is likely to have
have accreted some planetesimals during its formation. We show that the sulfur
abundance in the atmosphere of the planet is probably lower than $2.27 \times
10^{-4}$. This abundance indicates that the planet is likely to exhibit a lower
metallicity than suggested by the retrievals. Furthermore, such an abundance
for sulfur is more likely if WASP-39b had been formed beyond the CO ice line of
its natal disk.
