Well clearly the detentions are not working!
So you need to meet with the school and ask what is going wrong. What is he doing exactly? How might he be deflected from this? Can something positive be found that he can shine at? Is a particular teacher the one who is giving detentions? What does your DS say about this? Can he explain why he does what he does?
There is no doubt that school can be an impossible environment for some children, especially boys. It is an artificial environment in which their natural exuberance is held in check in ways that are just unsupportable. It often suits girls better, many of whom enjoy getting stuck into a sitting-down task.
I know in the school where I am CofG, the teachers recognise this and there are regular moments when the children are allowed to stand up and jiggle around, do star jumps etc. They are allowed to be children.
You cannot let this continue ... imagine if you were at work and being disciplined all the time. He will get into a pattern that he cannot break; and will have to endure constant reinforcement that he is not acceptable.
There is a mismatch here between what your DS can do and what he is being asked to do.
But, having said all that, it must be driving the teachers nuts - so finding a solution is important for them and him.