The number of boats are 8; so, he needs a total of 8*126 gallons.
In order to get the partial products, first you have to decompose 126 in its hundreds, tens and ones, that is, 126 = 100 + 20 + 6. Then multiply each of this terms by 8, as follows
8*100 = 800
8*20 = 160
8*6 = 48
Finally you have to add the results of these multiplications, that is, 800 + 160 + 48 = 1008. Therefore, he needs 1008 gallons for all the boats.