What the link about Pell/AOTC coordination is saying, is that Pell can be allocated to QEE or non QEE to maximize education tax credits.
But in the examples given, the expenses weren’t all covered by scholarships and Pell.
Pell was allocated to tuition in one example and that resulted in no AOTC.
Pell was allocated to living expenses in another example, freeing up some QEE to be claimed for AOTC.
These examples don’t really reflect your situation though.
For son 1 you have a TGTP that is restricted by its use to tuition and fees, so all other aid (including Pell) becomes taxable because it pays for non QEE.
But the books are also QEE and were paid out of pocket.
So they can either be used to claim AOTC or reduce the taxable amount of scholarships.
For son 2 you have scholarships and Pell covering total COA (tuition, fees, room, board, $800 books, $5,200 misc expenses).
Only the part that covers QEE is nontaxable, and the part covering non QEE is taxable scholarship.
So the part that covers tuition, fees, and books would be nontaxable, and the part that covers room, board, misc expenses would be taxable.
And then you can’t claim AOTC.
That is my understanding of the rules, but I’m not a tax expert.
And if I’m wrong, please feel free to correct me.