If you've ever worked from home while having little kids run around then you know how hard it is to concentrate. Trying to balance your working needs with the needs of your kids is a challenge. Over the last few months, my wife and I have experimented with a variety of solutions, and needless to say it's a difficult balancing act we'll never get quite right. However, a few trends emerged from our experimentation and have proven effective at helping us keep our sanity.
Boundaries and rules are always important. Also, being consistent with your boundaries is an important factor.
Having a separate room for your office gives you many benefits (especially if the room has a door you can close), and should be a priority if you have the option. However, if you're like me, and can't close a door, the next best thing is a good pair of noise cancelling headphones (provided you have someone around to listen for your kids). Also, baby gates and/or play pens can be effective methods at distancing yourself.
This boundary applies to both you and your kids. For yourself, you need to find ways to mentally separate yourself from the commotion in your house and get into 'the zone'. When you discover what that is, invest in the resources necessary to consistently put yourself in 'the zone'.
For your kids, you need to find ways of consciously and subconsciously letting them know you are working and can not be disturbed. One of the methods I use is my headphones. I've reiterated to my kids that when my headphones are on it means I am working. If they are off, they are free to come to me.
We've found one of the best ways to get our kids to behave is to give them undivided attention early in the day. By giving them the attention they're looking for, it makes it easier (on me and on the kids) to later break away from the fun to get work done. The key is to make sure when you're hanging out with them that they're the focus. It means not doing work on your phone while you're playing, which is something I still struggle with on a daily basis. However, over time it becomes easier to set down the phone.
Do your kids like to read, craft, do activity books, etc? If so, find time in the day to let them engage in stimulating activities they can do themselves. This provides you and your kids much needed personal time. We try to be mindful of what we let our kids engage in every day, but sometimes TV becomes the option (even then they only watch age-appropriate, educational shows).
In the end, every kid and every household is unique. The important thing to remember is to show your kids you love them, and make them aware of your need to get work done.