Sounds like he's got some hay stuck in this anal sac (It's a good idea to check it on a regular basis to make sure it's clean of debris, hay, bedding ect.)
Try getting a good hold on him so his back is against your tummy with his legs resting on yours, this way it's harder for them to squirm...