If he is not focusing in class, but focueses better alone, I would strongly consider ADHD. Not all ADHD kids are hyper, some appear largely as space cadets if there is too much stimuli around them. Is he slower with his work than the rest of the class, on average? Is he losing stuff, forgetting stuff, off-task?
7-year-old DD has ADHD and can focus for very long periods of time at home, if it's something she's interested in (even when she's not medicated)--for example read 2 chapter books in one sitting or do a large jigsaw puzzle--so that threw me off for a long time. I had to actually go in to class and see for myself what was going on. There's just so much stuff going on at school she can't focus or stay at task and little to no work gets done. She is "normal" on meds, however.