Sounds very much like my DD at that age.
If he responds so well to time with you and to praise, it sounds as if that is what he really needs more of, and he also needs to learn to get this encouragement and sense of self worth from himself, as part of how he thinks of himself, so feeling good about himself is normal and doesn't give him an inflated sense of self worth. I know it seems as though that isn't the case, but it is as though he's starved of any attention because he doesn't feel good about himself all this screen time is a kind of escapism, a useful coping mechanism. (Let me stress that this isn't your fault, it is just a part of growing up, and just as much a part of parenting as reading to little ones, or teaching them to ride a bike. Also, having a coping mechanism is a good sign). I think if you find ways to help him tackle the low self esteem, by encouraging him to get a better idea of himself, beyond black and white. it's a complex world we live in - is it relationships, respect and being sociable he needs to work on, or tidiness and household chores, or respect and behaviour? Pick one at a time, and praise him as much as you can, in different ways - smiling and nodding and listening is good.
Also, let him hear you say good things about your DH, that you love him and appreciate his role in the forces as well as who he is and enjoying his company/missing him when gone. (I know this can be hard, and I'm not saying you should dwell on it, but I had a tendency to not mention DH when he was away working and it made things worse, we just all closed down emotionally and bottled things up instead of enjoying time together for what it was without DH there.)
In secondary school, they encounter a range of new peers, some of whom will be so much more emotionally developed or confident or impressive and it can make them feel inadequate and question themselves. They can want to be like someone else without knowing how to get there. So it's a matter of bit by bit, talking about how their day went, talking over what they've learned and what happened, and giving them those skills as you reflect on your own day's highs and lows and how you might have done something differently, or what you felt well prepared for that was successful. We can't manage it every day, so we go for at least once a week, preferably 2 or 3 nights a week around the table at dinner. One person talks at a time, and no one is allowed to put anyone else down. It was hard at first, but better when they have a friend over who is used to eating at a table and does the same kind of thing.
Again, don't know if this will help, but it's what has helped us. At one stage I said to DD 'I don't actually believe a lot of the things I say in our discussions, you know. I often just come out with something to see what it sounds like and see what the rest of you think about it, I'm ready to have my mind changed.' Some how, that was the break through, and also acknowledged that she's constantly changing too and so I shouldn't repeat anything she says as though it's fact as she is likely to have changed her mind, or think differently by then.