Jupiter
It is suggested that Jupiter formed about 3.5 astronomical units from the Sun. It started migrating inward and scattered the rocky planet-forming materials out beyond its orbit. Saturn formed later than Jupiter and started its own inward migration. When Jupiter reached 1.5 astronomical units, it became locked into an orbital resonance with Saturn. Both planets turned around and moved outward until Jupiter arrived at its current position, 5.2 astronomical units from the Sun. Saturn arrived at about 7 astronomical units.