There's no definitive law yet
As of yet there is no international treaty that specifically addresses mining the moon. There is the Outer Space Treaty of 1967 which says the moon is the "common heritage of mankind" and that no nation can claim it as sovereign territory. There was a later Moon Treaty which no spacefaring nation has signed.
I suppose the first missions to mine the moon will be small enough to be classified research missions, but there will obviously have to be a new treaty before major mining operations are allowed. The truth is that if the US or China want to start major mining operations, who is going to stop them? It would have to get really valuable before it's worth going to war over.