You don't say which credit you are talking about, or tuition, or a 529 plan. The list of "qualifying expenses" is slightly different for each type of tax break.
Generally, room and board is never eligible for any tax breaks, even if the school requires the student to live on campus. (The student would have required food and a place to stay no matter what, and personal living expenses are not eligible for tax breaks.) And if a scholarship is more than tuition so that it is partly used for room and board, that part is taxable. However, I believe room and board might be allowable for a 529 plan.
Review publication 970 for the type of credit or tax break you are interested in. https://www.irs.gov/forms-pubs/about-publication-970