Each tank goes for
[tex]12 \textrm{ gallons} \times \dfrac{22 \textrm{ miles}}{\textrm{gallon}} = 264 \textrm{ miles}[/tex]
How many times he'll have to stop will be related to
[tex]\dfrac{638 \textrm{ miles}}{264 \textrm{ miles per tank}} = \dfrac{29}{12} = 2 \frac 5{12} \textrm{ tanks}[/tex]
He started with a full tank so that means he'll have to fill up twice, once after 264 miles, once after twice that, 528 miles.