Here are 2 great articles on roosters and their behavior- lots of information and ideas to help.
http://chickenrunrescue.org/filter/Care-and-Rehabilitation/Rooster-Behavior https://www.backyardchickens.com/articles/understanding-your-rooster.75056/
At 5 months old, it sounds like he is coming into a strong hormone stage and doing what roosters do naturally at that age. If he thinks it's his job to protect the pullets, then he may have seen you as a threat as you tried to get the one back in the pen. There are some great articles on...