In our imagination, the Solar System appears as a central star, around which all other objects should rotate. And this is logical, because before us is the most massive object with dominant gravity. That's just Jupiter violates this rule, because it does not rotate around the sun.
Jupiter is not just a gas giant, but the largest and most massive planet in our system (it is 2.47 times more massive than the rest of the planets!). With such a mass has to be considered at the physical level. Therefore, a special relationship has been established between the Sun and Jupiter.
In essence, Jupiter does not rotate around a star. Both objects make mutual rotation around the spot in the empty space between them - the barycenter. Yes, the Sun still affects gravity on Jupiter, but the gas giant responds in the same way, forcing the star to dance to its tune.
More precisely, we are facing the only planet in the Solar System whose center of mass with the Sun is located outside the star at a distance of 7% of the solar radius. The main star is 1000 times more massive than Jupiter, but objects influence each other proportionally. Therefore, while the gas giant performs rotation in orbit for 11.8 years, the Sun is moving at this time around the barycenter.
Distance from Jupiter to the Sun at the closest and furthest point
This is a really important fact for science. If we talk about the technical application, then exoplanet hunters can track similar oscillations in other star systems, which will allow them to reach massive objects.
If you are already completely delving into the details, then all the planets influence the Sun gravitationally, so they do not rotate exactly around the center, but it is still inside the solar plasma. But Jupiter was massive enough to shift this center of mass beyond the solar surface. But the gas giant still remains subordinate to the star, therefore, although it affects it, it is forced to follow the general rules of rotation.