Those symptoms sound like the animal is in pain.
General changes in behaviour
Behavioural changes such as lip curling, trembling, vocalization and abnormal postures have been described in lambs undergoing tail-docking or castration. In general, sheep in pain may show the following signs:
Reduced feed intake and rumination.
Licking, rubbing or scratching painful areas.
Reluctance to move.
Grinding their teeth and curling their lips.
Altered social interactions.
Changes in posture to avoid moving or causing contact to a painful body area.
From:
https://www.fawec.org/en/fact-sheets/51-sheep/238-assessment-pain-sheep
I can't comment on the source of pain. If nothing external is obvious and rubbing is focused on the head, I would guess an abscess tooth or jaw not yet visible or maybe an ear infection. Maybe something in the eyes or brain? I can't say for sure. It's best to get a large animal vet to examine the animal for unseen pain sources.
If the loss of appetite is due to pain, pain medication would hopefully get the animal to eat again.
This face pain scale for sheep is another assessment of pain you can check for and refer to when asking the vet to come. Or put it out of its misery, whatever is feasible for you.
From:https://www.sciencedirect.com/science/article/abs/pii/S0168159116000101