Answer:
Both tanks
Explanation:
This is a unit conversion problem. We need to know how many gallons are there in 40 pints and with this information we will know in which tank he will need to fill in the bottles. In order to solve it we need the equivalence between this two measurement units. Which is:

This equivalence can be used as a conversion factor like this:

Applying it to the problem we can convert from pints to gallons:

He will need both tanks because neither of them has enough gallons to fill 40 one pint bottles.