Here you have given symptoms of pain in buttock as well as both the legs and it gets worse if you sleep on either side for that side. Apart from this you have also given symptoms of hands becoming numb when ever you sleep to one side the opposite side hand becomes numb.
As per your symptoms it looks like you have issues with your back
lumbar spine and due to this you have pain in buttock as well as in your legs. I suggest you need to do a
MRI of lumbar spine and check further with orthopedic doctor followed by physiotherapist.
Apart from this the
numbness in hands indicates there may be problem with
cervical spine as well deficiency of vitamine B , vitamine D as well calcium. How ever the conformation can be done by
blood test. And physical examination by orthopedic doctor.
Here for your pain at buttock and leg level as per the evaluation done by your doctor if there is no major issue then
physiotherapy treatment and exercises will help you a lot. So I suggest do visit a physio for treatment of pain as well take suggestion on posture for further precautions. And follow the spinal exercise program as per suggestion of physio for stregthening and flexibility of spine.
At home you can also use hot pack and apply some pain relieving ointment after it for some more pain relief. As well do not do any activities which use to aggrivate your pain.
I am sure it will be helpful for you when you follow all above advice. Take care.