I assume you mean other than 0(a) which is always 0.

A product is congruent to 0 (mod n) if and only if the product is equal to n or a multiple of n. Looking only at numbers less than n, that means the product must be equal to n. Except for products with 0, that can only occur when the two numbers are factors of n which means that n mustnotbe a prime number.