First of all, when someone creates a block, he broadcasts it to the rest of the network. If there are two people that create the block at the same time, they will broadcast it. So, you will get two blocks at the same time. Although you save both blocks, you will try to mine one of them. After some time, one of the two branches will be longer, so you will delete the second one.
In Blockchain, a block is considered well when it has a few blocks above it. So, the reward is taken by the individual when one of the chains has a longer branch.