A 3 year old only has to 2 to 3 minutes of attention span.. And so you need to be prepared to distract him or keep him engaged.
At home he needs to be taught to stay in his chair. To use his inside voices.. etc.. That is where he is going to learn how to behave out in public,
Also "We tell him that he needs to behave and he'll be good ".. This is too vague.. What does this mean to a 3 year old? Nothing.. It is too abstract..
Instead you need to say, "We use inside voices here."
"We keep our bottoms in the chair at the restaurant."
"We will take you for a walk in 10 minutes."
Then you need to keep him engaged while you are waiting to order, while you are waiting for the food.
At home you do not have him sit at the table until dinner is ready to be served.. And so at a restaurant you all are just sitting there.. Take some snacks or give him some bread or order something that can come to the table really fast.. Take colors, little cars, read him a book..
We used to take turns taking out daughter outside about every 15 minutes at this age. She only needed about 3 to 5 minutes to walk around and then would be fine for 15 to 20 minutes at the table.
Be sure you are eating at "Family" friendly places.. No point stressing out at a place that people are paying money for the atmosphere.
There were times, we knew our daughter was just not up for eating out. So we would do take out.. It is just like adults.. If you are in a bad mood, you know you do not want to deal with others.. so you stay home.
Try not to set your child up for failure..
And Praise, praise him while he is doing well.
I like how you are using your inside voices. I like how you are staying seated in your chair. Thank you for sharing your bread.