If it is a Scarlet Skunk Cleaner Shrimp, Lysmata amboinensis, it has a life span of 4 years. It sometimes hides in rock after a molt until the new exoskeleton forms. Many times it will eat the molted exoskelton in order to strengthen the new one.
In order to molt, there needs to be some iodine in the water. It will then molt, hide in rock for a bit and then emerge with the new exoskeleton.
I hope that is the case for you.
Tom
OceanGuy