Agree with all the CS Basics book (would add the Code: The Hidden Language of Computer Hardware and Software, great book and if he has time, I'd go for it). I'd also consider giving him a couple of books, like: A) Clean Code by Bob Martin, B) Soft Skills by Jon Sonmez. Books that doesn't require a computer, yet teach the reader how a good developer should think while writing code and working in a team. It's also less likely he gets stuck while reading this kind of literature.
Would help if you shared the end goal. Get hired anywhere? Get hired by Top 4 Tech Company or Hot Startup of the Year? Start a business? Don't get bored? How long is he going to be incarcerated?
I would greatly appreciate if you shared your experience.
I assume it's for fun and to learn