L.,
A lot will depend on how you hold up in front of them. At 2 and 3 yrs old, too much information will just not register and sometimes even give the wrong impression.
If you feel sad - you will need to explain why and not cover it up. If you feel angry, you will also need to explain to them - otherwise they will make their own conclusions - AND THEY WILL BLAME THEMSELVES. It's very important that they understand it is not their fault. (I've been divorced a couple of times and if you are okay, your children will be okay).
If the man you are divorcing is their father, there will be some emotional fallout from them now, and a lot more when they get a little bit older - and a WHOLE LOT MORE when they hit adolescense...all children are different though.
If he is a step-father, and hasn't been in their lives long there will be less difficulty for them. However, I don't want to make this sound like a cake-walk ... divorce is always, always hard on children - please know that going in.
For now, all they might need to grasp is that Mommy and Daddy are going to have two houses and you get to have a room at Mommy's house PLUS a room at Daddy's house, etc., Two and three year olds THRIVE on routine - so please try to have their routines disrupted as little as possible and transition the routines as gently as you can for them. If there is a grandparent within your reach where your children can visit and be in a "familiar and unchanging environment" during this difficult and changing time, it might be a good idea to call on them for extra support.
Meantime, as others mentioned - they most importantly need to know they are loved and are going to be cared for. And when they ask - what does divorce mean? (and they will) be sure to explain that only grown-ups get divorces, Mommies and Daddies NEVER divorce their children.
best of luck to you. hugs,
W.