You're used to how things work with atmospheric drag. Since there is no atmosphere in space the results of the ice in the comet sublimating tends to hang around the comet until the solar wind pushes it away from the sun. Anything on the sun's side of the comet will initially move forward of the comet.
When the comet is traveling away from the sun, the tail leads the comet on the way away from the sun. When it is closet to the sun, the tail generally perpendicular to the travel path.
if that’s the case, then when a comet is in the middle of deep space, wouldn’t it look like a sphere and be dark, since there would be nothing to light it up
of course, the stuff being pushed outwards might not happen as the mass itself isn’t being heated