It must be a number lower than a specific threshold. The threshold is calculated based on previous blocks. It can be gamed, but the idea is that in a highly competitive market gaming gaming won't be practical. On testnet they used to game it all the time though, probably still do.
Discussion
okay, so it's say under 10^15, and it can be any number, but how does it pick which number?
Any number that has enough leading zeros counts, and the miners pick the number by guessing. Sometimes the guess comes in with more leading zeros then needed, picking a much harder number then required!
The number is the double-sha256 hash of the block header. Part of that header is determined by what goes in the block, but a part of it is an arbitrary number that miners can change at will, the "nonce". Miners change that number a bazillion times and do the hashing again and again until the result of the operation is a number smaller than 10^15.
Learning this is what really blew my mind on Bitcoin the first time. The second time was when I baked my noodle on ECDSA and how that works.