If your rocks came loose and fell off, you can use a combination of superglue gel and coral putty to put them back.
Put some gel superglue on one of the rocks, then smoosh a ball of coral putty on top of that superglue. Next, put more superglue on top of the putty, and smoosh it against where you want the rock to stick. Hold it in place until it sets. When it dries fully, it should be at least as durable as the rock itself is. Make sure to wipe away any excess superglue that sticks out, as fish and hermits can get stuck if they bite at it.
For future reference, it's best to put a summary of your problem in the title, so people know what you need help with. A title like "rocks came loose" or "what underwater glue to use on rocks" would be good here.