How was the space shuttle fuelled

The shuttle external tank held the propellants for the shuttle main engines. It was filled from spherical tanks positioned at the perimeter of the launch pad. Insulated lines ran from the spheres, through the Mobile Launcher, and into the Orbiter through two tombstone-shaped Tail Service Masts.

Then through the Orbiter Main Propulsion System plumbing into the External Tank.

Here is a schematic from the Ascent Pocket Checklist showing how the fill and drain lines from the Masts (highlighted) teed into the lines going to the External Tank.

Here is a paper about the Tail Service Masts.

A picture of the Tail Service Mast (TSM) attached to the Orbiter's main propulsion plumbing system. One service mast delivers LOX (oxidizer on the right) and the other delivers LH2 (fuel on the left).