I had a very similar issue with mine - after a lot of doctor's visits, I ended up trying Good Start soy. I was half breastfeeding, so I eliminated all milk products from my diet. The combination of those things helped. He's now 7 months and finally able to be on the soy formula solely. He couldn't stomach any of the other soy brands - only Good Start. I would suggest you try this brand - either regular or soy - it's supposed to be more easily digestible. I know it worked for us in getting rid of the stomach pains/gas.
If you can, it wouldn't hurt to have an ultrasound done on his abdomen area to make sure everything is as it should be. Our doctor ordered that to make sure there were no knots or something else that might be causing pain. In our case, it was just that his little system was lactose intolerant until it matured. Good luck - hang in there, I know it's tough to watch your baby suffer and not be able to fix it!
One more thing, when he does have gas, try laying him down and "cycling" his legs gently, rub circles on his belly with slight pressure, hold his legs (knees towards chest) and pat his bottom - these will help him get the gas out and may also distract him to stop crying.