He is still young, so in the beginning, he will not understand that he is going to get his toys back.
Positive reinforcement and practice are how you can teach him to share.
You need to show him how to share with you. If you are going to eat a piece of fruit, be sure to share it with your child. Use the words "I would like to share this banana with you".
When your child is served a piece of fruit, ask him if "he will share a piece" with you. Each time this is done with a positive outcome, tell your son "nice sharing!". Try this also with his friends. Ask him to share his fruit and again always tell him "nice sharing" or "I like when you share".
When you play with him, do the same thing. Ask him if he would like to share the toy you are playing with, then ask him to share with you. Each time tell him "nice sharing".
When he plays with friends and you see him share, tell both of them, "I like it when the two of you share".
We have a neighborhood with tons of kids and all of us, use this technique. It works great. We also all say "thank you" and "please" for each transaction with each person. It is amazing how many people compliment or kids on the behavior of our children.
You are going to end up with a very nice young man.