Foils stands for first, outer, inner, last.
For example:
(3x + 5)(2x + 3)
Multiply the firsts together.
3x * 2x = 5x²
Now multiply the outer together.
3x * 3 = 9x
Now multiply the inners.
5 * 2x = 10x
Now multiply the lasts.
5 * 3 = 15
so the answer would be:
5x² + 9x + 10x + 15
5x² + 19x + 15
Hope this helps :)