It is actually fantastic that he is chatty. This shows he's a highly verbal child and all his talking only helps develop his verbal sense. As the mom of a child who also was talkative and is now in third grade and great to talk with, believe me, you will be so glad that he is well on the way to being able to articulate his thoughts, needs and wants to you -- it's far preferable to having to drag everything out of him or struggle to understand his wants. So try to be positive about his chattiness.
Yes, you don't want him chatting constantly in public, but I agree with another poster who said your expectations are perhaps unrealistic for his age. Having him "obey the command" as you put it is outside his reach right now, and if you treat this like he's misbehaving, he could see that as mom and dad showing they don't care what he has to say, even though you know you're really only trying to teach him boundaries. Boundaries are important, but at his age, he just finds the world too interesting not to start sharing it verbally with you or talking about it to himself. As for training him at home to be quiet in other places, imagine his mind when he gets to those other places that aren't home -- it's all so interesting, so different, that his home lessons will go out the window because he's somewhere new.
So yes, take plenty of stuff for him to do, like you already are, but remove him from the event or service if he gets too chatty.
As for special events: Does he really need to attend weddings or funerals, etc., where his chatting gets in the way of adults' participating? Can you get a babysitter for those kinds of once-in-a-lifetime events that are really designed for adults anyway?
As for church: Does he really need to be in the main church service or is there a "children's church" or kids' Sunday school during adult worship he can attend,where he'd actually get more out of it? If there isn't -- I'd bet other parents at your church would be thrilled to participate if you suggested starting such an arragement, with parents taking turns shepherding the kids so the parents get chances to be in the main worship service regularly. (The solution at our church: The younger kids are present through the first 15-20 minutes of worship, then after the children's sermon, go to a classroom for age-appropriate activities for the rest of the service. That way they get the experience of being in "big church" but also get age-appropriate, fun lessons, while the adults are able to concentrate on the sermon. The elementary-age kids usually participate in the adult worship service but sometimes go off to help with the younger ones.)
It can drive us adults crazy, the chattiness, but it beats crying, whining or, even worse really, silence. Like eating or using the potty, talking is one thing HE can control and you can't, and he's at an age when he wants and needs some kind of control. Don't make this a huge battle with him but instead use distraction, occupation and if needed, removal. Good luck.