There could be several reasons for this, or any combination of these reasons, and thus you can try different things to teach attention:
1. At 6 months old, he is an adolescent, and it is normal for them to have the attention span of a flea. Sometimes, just 2 seconds of attention is all you can reasonably expect.
2. He is bursting with energy and restless. you might try exercersing him a bit first before trying to do attention training. take him for a run, or throw the ball for him until he is tired. Then when his excess energy is expended he can more easily settle down and pay attention and be interested in you.
3. Or, he is overly tired, as in too tired to concentrate. For example after a long hard day at work, you are tired and probably won't learn a new skill as easily as if you were more refreshed. If this is the case, then do the attention training when he is less tired. Also, a dog can be mentally tired though not physically tired (for example if the training session is going on for a long time), and vice versa.
4. The training environment is too full of distractions. Eventually you want the dog to pay attention to you around distractions (the purpose of the training). But you need to start with zero distractions when teaching and practicing this skill. Start in the most boring location (to your dog) that you can think of, like maybe your living room when all his toys are put away, any other pets in the house are in other rooms, any other family members are in different rooms, no TV on, no radio on, you get the drift.
5. Maybe your treats or rewards are not high enough. use something that your dog really likes.
6. Or, maybe your treats or rewards are too high value. If the dog is preoccupied with the treat or toy, for example busy scanning your hands or searching for the toy or treat, then the treat or toy is actually a distraction rather than a reward. If you think this is the case, then use a more boring reward, like his regular kibble for example.
7. Maybe you are going too fast too soon. start by asking for a split second of eye contact and reward that. Once the dog is offering you split-second-long eye contact consistently (which can take many sessions depending on your dog, your timing and consistency, the environment), then increase the duration to 1 second before rewarding, and stay there for however long it takes for your dog to do that consistently. I'm not kidding, literally split-second in the beginning, then progressing to 1 second and no longer.
Then when he can do 1 second consistnetly, progress to 2 seconds. When he can do that consistently, progress to 3 seconds. All of this is still in your zero-distraction environment by the way.
I'd say, when he can maintain 5-10 seconds of eye contact, then start introducing the mildest of distractions, and immediately drop your expectation down to 1 second again and rebuild from there.
Don't worry if it seems incredibly tedious. Working with adolescent dogs is a challenge in some ways, but when the groundwork is done slowly and solidly, then later on the progress realyl speeds up. And attention training is so fundamental that I would go really really slow with it. good luck!!!
One more thing, don't make the training sessions too long. end each session on a good note when the dog is being successful. There's a common tendency to keep pushing and repeating, but don't. It's much better to ask once for a split-second of eye contact and be successful and quit for the day, than to do it ten times in a row and half of the time is not successful.