He needs 3 boxes.
He has 7 friends and they each get 4 cookies so
7x4=28
If each box has 12 cookies then you can divide the amount of cookies you need by the amount in each box and get
28/12=2.333...
And since we don’t want to leave any of his friends cookieless we need to round up to 3 boxes