。
A shepherd was watching over the sheep.
Literal
Shepherd [subject-が] sheep [possessive-の] watch [object-を] was-doing.
羊飼い ('shepherd,' literally 'sheep-keeper') is a compound of 羊 ('sheep') + 飼い (masu-stem of 飼う, 'to raise/keep [animals]'). 番をする ('to keep watch / stand guard') is a set expression — 番 ('turn / watch').