If you do a little number theory, you will realize that the sum of two even numbers and two odd numbers is always even. Therefore, you are looking at all the possibilities of obtaining two numbers of the same parity. The sample space of an 8-sided die rolled twice has a size of 64 outcomes. However, we are only interested in a specific subset of this sample space, namely, of numbers with the same parity.
On your first roll, you can get anything, but you have two options: either an odd number or an even number. On your second roll, you are only interested in a number whose parity matches that of the first number. In the case of an 8-sided die, you will have 4 options. Hence, it is easy to see that you will have a sample space of 16 favorable outcomes.