It´s hard. I started working at home when my firstborn was 13 months old and it took a while to get into the swing of things. We had just figured everything out when I had my second son. Now I try to work with a 21 month old and a 4 month old and it is literally impossible some days!
My best tips for babies: A sling never worked with my boys, they want to see new stuff, so I put my little one in his bouncy chair and stick him outside in the shade. He kicks and laughs to himself and I can see him from the computer. I also give him different clothing to play with, at 3-6 months, they really enjoy rubbing different fabrics between their fingers and tasting them, just switch in a new piece of clothing every five minutes or so.
For 1 year and up: This age tends to want to spend a lot of time with Mommy. While it´s sweet, it means it´s hard to get much work done! My son loves cars, so I keep an extra supply of new ones (from the dollar store) on hand and when I am up against a deadline, I break out a new one. He´ll spend quite a while driving it around the bed.
Another idea for older kids is to let them get messy. They seem to be happy if you leave them with a bucket of mud or cornstarch and water! Also, bubbles are good because you can blow a few, then type a bit, blow more, type a bit, etc.
Sometimes my older son sits on my lap and colors while I do things that only require using the mouse, not the keyboard. That way, I just move the keyboard out of the way and he can color in front of me while I mouse around.
Most of all, I think you have to be flexible! It´s not easy working from home with little ones, but it is rewarding! And all too soon, we´ll be able to work in complete peace and quiet and be yearning for some sticky hands on the keyboard.