Chosen Solution

I had accidentally dropped my Samsung in water and after taking the battery out and putting everything in rice everything is normal but the home button and back button wont work now.

The rice thing is a internet lie. It will not do anything except possible get rice in the charging port. The only thing you can do is pull the phone apart and clean the corrosion off the the connections. Look for green stuff on the electrical connectors. In my opinion the model of phone you have is not worth fixing. You can buy a used one for about 25 to 50 dollars.