FOIL is an abbreviation for the words first, outer, inner, and last. It is a mnemonic to help with polynomial multiplication.
Take a look at this example of multiplying two linear monomials:
There are 4 distinct products which have to be computed. Here they are highlighted:
The product of the highlighted terms gives:
Adding everything up, we get
Note: The point of this is to remind you to multiply everything in one set of parenthesis exactly once with everything in the other set of parenthesis. As long as you understand that this is why you do this, it doesn't matter what order you do it in, as long as it all gets added in the end. And so, F+O+I+L is the same as O+L+I+F, L+I+F+O, F+L+O+I, etc.