Dog scared of me what do I do?

I’ve had my dog for 2 years now. Recently, he has begun to show signs of being scared of me. He won’t eat or drink water when I am around and he will only play with our other dog when I have removed myself from the area. I’ve tried giving him treats after eating, giving him more attention, taking him on walks with just him and me, and pretty much everything else you could find on google and yet the problem keeps persisting. Its gotten to the point where I am considering taking him back to the shelter. Can anyone offer me advice on what to do?