529Plan and 1099-Q

I paid for my son's college tuitions since 2019 and all were direct ACH from my bank account.  I also paid for his boarding and room which I transferred money to his bank account and he could pay the rent.

I made distribution from the 529 plan last year to cover the 3 years college tuitions and boarding expenses.  I was the recipient of the distribution.

I received a 1099-Q for 2022.  I entered Box 1 and Box 2 on the 1099-Q on my tax return.  However I was taxed for the earning on Box even though I believed all this is a qualified distribution.  If I claim my son as dependent, I cannot find a place in turbo tax to claim the qualified tuitions and boarding expenses.  If I do not claim my son as dependent, I could be able to enter the beneficiary name and claim the expense.  But this is causing issue on my CA tax return and I could efile the CA state tax return.

Any advise please.