There is ongoing scientific debate about whether or not crabs and other invertebrates are capable of experiencing pain in the same way that humans and other vertebrates do. Some scientists believe that invertebrates, including crabs, may have the ability to feel some types of stimuli, such as touch and pressure, but may not have the capacity to experience pain in the same way that humans do.
Other scientists argue that invertebrates, including crabs, have complex nervous systems that are capable of processing and responding to stimuli in ways that are similar to the way that vertebrates do. These researchers suggest that invertebrates may be able to feel pain and may have the capacity to experience suffering.
Currently, there is no definitive scientific consensus on the issue, and more research is needed to fully understand the capacity of invertebrates, including crabs, to experience pain. In the meantime, it is important to handle all animals, including crabs, with care and respect, and to minimize any unnecessary suffering.
In the case of boiling crabs, it is likely that the crabs are experiencing some level of stress and discomfort as they are being cooked. However, it is not known for certain whether or not they are capable of experiencing pain in the same way that humans do. Some researchers suggest that the crabs may be more likely to experience stress and discomfort than actual pain due to their unique nervous systems.
They likely do not die immediately when boiled, however it is hard to know. Keeping them on ice and putting them to sleep first may help with this. Read this guide on how to kill a crab humanely.