For the first digit, you have two possible choices: 1 or 2. For *each* of those choices, you can choose 1 or 2 for the second digit in the number, and for each of *those*, you can choose 1 or 2 for the third digit of the number.
That’s 2 * 2 * 2 or 8 possible 3-digit numbers you can make with the digits 1 and 2.