It's kind of murky because in commutative algebra that is actually not the definition of a prime. It just so happens that the prime numbers are precisely the natural numbers with this property. It's fine to define prime numbers that way, but in more general contexts a prime element is actually an element p which cannot divide a product of two elements a.b without dividing one (or both) of them. It just so happens that the non-invertible natural numbers with this property also aren't able to be written as a product p = c.d such that c != 1 and d != 1. In other number rings this isn't necessarily the same thing.
Is something missing here? As I understand it, that general definition works like this:
6 divides 49, but does not divide either 4 or 9. Therefore, 6 is not prime.
But I'm pretty sure 1 cannot divide the product of two integers m, n* while failing to divide m and n individually. So while that general definition does exclude composite numbers, it doesn't seem to exclude 1?
The correct "general" definition also requires the prime element to be non-invertible and non-zero, thus 1 is excluded.
It should be noted that this definition excludes "composite numbers" only when the ring is an integral domain. In a general commutative ring this isn't necessarily true.
For this and the "general" definition to coincide, the ring in question has to be a unique factorization domain, which the integers are an example of. In any bigger subset of rings (integral domains or general commutative rings), there are rings for which this doesn't hold.