I'd say it's sweetitch you can by creams and sprays and maybe you could get a sweetitch rug which has a long tail flap for coverage against irritating fly bits
My horse rubs and it was all bc his sheath wasnt clean so maybe check that 😬😬
I don't know the specifics of it all but you might want to consider worming your horse. Sometimes horses will itch towards the doc if they need to be dewormed. But again it could be anything like sweet itch or something else.
Is he pretending with dry flaky skin? It might be sweet itch it sometimes flares up in the summer time. For this you could use a
It may also be rain rot/dew poison.
Mikroteck comes in a shampoo and spray, it promotes hair growth. Have a look in a tack shops you may find some go stuff.
My horse does the same thing. If it's a gelding sometime they need sheath cleaned if he kept itching the tail
I'm no expert at all but maybe get like an itching cream? Maybe something is irating him? I'd ask your vet.