S.H.
Well he is almost 2 after all.... so any expectation of him, has to be in line with his age-set. Otherwise, frustration will arise, for both Parent and child.
At this age, they do NOT have fully developed "impulse control" yet, nor the complete understanding of "why" they have to sit at the table for a period of time. Even 4-5-6 year old kids will and can squirm at a dinner table or at a restaurant. So KEEP this in mind, to keep things in perspective.
IF he tantrums, just go about and have your dinner anyway, with Hubby or just you. Try not to "convince" him "not" to yell.... meaning, he's going to yell anyway. But, make your stance and tell him "no yelling..." and don't get into a battle about it. For some kids, interacting in the tantrum, just makes them tantrum more and makes it worse.
A child WILL 'deflate' on their own, whether or not we are in the tussle or not.
Sure, guide him. But anything has to be age-appropriate. AND, habits like this (ie: knowing the purpose of dinner and sitting together, nicely)... is an "ability" that is attained over time.... THAT is the key.
Certainly, at 2 years old... they are not going to sit nicely like a 6 year old. 2 year old children have ants in their pants... and their attention spans are not prolonged either. Thus, just let him try his best... but don't expect "perfection" from him, or at least not yet. "Habits" like this take time.... to build-up. Like a rock collecting moss.
So, pick your battles. This is a time of "tantrums" as well... it was bound to happen. A great book is "Your 2 Year Old" which you can find at www.amazon.com It nicely explains what a 2 year old is like for the Parent. So they can understand them.
I would not "expect" him to sit at the table.... much less, quietly or like a statue. He can't. He's too young. He's probably also just too distracted by dinner time, or tired... or just that fact that BOTH his parents are home... together with him, is enough to make a child just too excited to sit still or eat. I know when my Hubby comes home from work, both my kids get SO SO active and loud and excited that their Daddy is home... and they will not sit still either. They have to get it out... all their emotions at the end of the day, of seeing Daddy home, of the night-time commencing etc. So, it's a real doozy for some kids.
Remember: age appropriate expectations, tantrums will happen, it will take time. I sincerely do not believe in punishments for things like this... he is just behaving as a child. But, GUIDE him in the ways of your 'rules.' Like anything... boundaries, and manners, and behavior takes time to attain. So, changes will not happen over night.
My son does not sit still either. My son is 2.5 years old. I really don't stress about it. I rather him be a child than have a big battle at dinner and then have to wrestle him and tie him to his seat, and have yelling. Not my cup of tea. But, there are nights when he IS great about it, and he does know that the dinner table is for sitting at.
All the best,
Susan