That is simply not true. There are no defined values for success or error and the OS usually doesn't even care what it returns. It's simply a user-defined value that you return.
Now, other programs can pick up this value that you return and interpret it in some way. That's what its purpose usually is. What the numbers means is up to the implementor, the coder - ie YOU.