The qualified education expenses must not include amounts paid using grants, scholarships, or other tax-free benefits.
Per IRS Publication 970 Tax Benefits for Education, on page 63:
Who Is Eligible?
You can take a distribution from your IRA before you reach age 59 1/2 and not have to pay the 10% additional tax if, for the year of the distribution, you pay qualified education expenses for:
Qualified education expenses. For purposes of the 10% additional tax, these expenses are tuition, fees, books, supplies, and equipment required for enrollment or attendance at an eligible educational institution. They also include expenses for special needs services incurred by or for special needs students in connection with their enrollment or attendance.
In addition, if the student is at least a half-time student, room and board are qualified education expenses.
The expense for room and board qualifies only to the extent that it isn't more than the greater of the following two amounts.
You may need to contact the eligible educational institution for qualified room and board costs.
Note that any link in the information above is updated each year automatically and will take you to the most recent version of the document at the time it is accessed.