Your problem is right here in your response. "I pet him when he allows it and give him his space when he doesn't"You need to let him know that you are the boss. That you are top stallion in this herd and he had better respect you. Right now you are letting him tell you that he is boss. As long as he feel he is boss, you will never get past this problem.
Whoa. The part I bolded says it all.
When he allows it? Give him space when he doesn't? NO.
You are the one to decide when something is to be done. You call the shots.
In a wild herd - there is a boss MARE that decides where they go and when... the stallion is defence. He does not call all the shots.
You need to be that boss mare. He needs to give YOU space and respect you.
Always.
I care for a stallion here who was a pussycat until he started breeding... in fact - prior to breeding he was
waaaay too dull in the show ring - lovely to look at but no fire, no sparkle. Now he has plenty o' fire - too much. He hates most of the other horses... he goes nuts if one of the geldings or the other (older, calmer, easy to handle) stallion goes by his stall. Sometimes he gets so wound up he will pace himself into a lather. He is the Energizer Bunny - he never stops. I can count on one hand the times I have seen him stretched out on his side, sleeping... ceasing his constant vigilance for a few minutes...
I try to keep him entertained. He goes out into a nice grassy pen or one of the pastures - unless he gets too wound up - then he can be in the arena and watch the daily comings and goings. He tends to be calmer there. He goes for walks. He gets toys. He gets one on one attention. I have pastured him with a couple of older mares - all went well at first and then after a few weeks a switch went off in his head anf he started to run them savagely... he had one of the most ornery, toughest, bossiest mares on the place running into the fence in terror and squealing and peeing in fright.
No more pasture mates. Ever.
And he gets more than a tap on the nose and a
NO! when he acts up. Occasionally he might still rear up in defiance - and he will instantly seem to think -
oh crap - bad idea!! - as I
will correct him... immediately. Firmly but fairly.
He knows that when I come into his stall or to his gate - he must back off and give me space until he is invited closer. He is NEVER hand fed treats. I AM THE BOSS MARE - and he knows that. He is never to turn his butt to me. He is one of only 2 stallions (out of the many) I have ever worked with - from Warmbloods to Thoroughbreds to QHs - that I have felt the need to always keep an eye on and read his every ear twitch, his every glance. The other was a 16.3 HH Thoroughbred - not a 34" mini. I would never let any little kids near him. Or inattentive adults, for that matter. He may take advantage of such situations.
And please no - no lip chains or mouth chains should be used by anyone who is inexperienced... it may only cause a wreck and/or make a bad situation worse.
I agree with those who suggest that you need to call a trainer in to help you....