He needs to know down/stay and you need to build up to a long down/stay (or wait) . You can use a throw rug for him, placed as far as you want him away from the table. I like about 10 ft for my dogs. You need to show him that lying down on his rug IS what gets him the goodies, not coming to the table.
Staying for that whole time is an awful lot to ask of a dog, unless they're like my Chi's and like to stay right there on the rug watching. "Wait" is a better cue than stay, actually because it doesn't mean to stay in exactly the same position. The whole dinner time is a long time for a dog to have to stay in one place.
You may prefer to teach your dog to stay out of the room where you're eating but not have to stay in one specific spot. It's up to you.
You'll need to practice several times a day. Set up pretend meals, even one person. Show him to his rug and put him in his down/stay. Get a treat of high value not from the kitchen table, but somewhere else and reward him before he messes up and rises from the down. Ask him to continue staying. Depending on how good his stay is, it won't take long. Reward him extremely frequently at first. Always try to get the reward to him before he gets up...before he even thinks about getting up. You want to reinforce that staying down.
Then once he's getting a pretty good down/stay, sit at your table after placing him. Get up before you think he's going to break the stay and take him a treat. (not from your plate, but from the counter or somewhere else) If you wait too long to reward him, he is more likely to fail. Set him up so he can get loads of reinforcers for staying put. Add a cue word, "stay" once he's getting reliable. Then gradually start spacing out the treats so he has to stay longer. You can give him a toy or chewy to have while he's waiting for you to eat.
If this is too much trouble to do...it takes a lot of diligence and consistancy, practice every day several times, you'll need to use a crate or tie him to the door knob while you eat. But of course, always supervise a tied dog so he doesn't strangle.
Remember, dogs do what works. Something must have worked for him to be begging at the table. Someone has either fed him or something has dropped down for him or he's getting attention for it. When you're practicing him, don't talk a lot, be calm and slow so he doesn't get all hyped up. No scolding or anger...just mater of fact, replace him calmly if he does get up. Hopefully though, you'll catch him before he does. You want to prove to him that by staying in the down position on his rug (or wherever you decide to put him) is the way to get goodies and not by coming to the table.