Deductions & credits

Ok I understood now all of it except the last paragraph: 

So on my son's 1099Q.  That MUST be entered as there was a distribution of $8,000 and there is only $1,000 of expenses left to support it.  So I have $7K extra distribution.  I still don’t understand the $2000 calculation.:) can you please explain further? Thanks.