Two and three years olds don't naturally share with each other. They fight, claim toys as "mine!" and threaten bodily harm on any siblings that get in their way. But for us, having two so close in age has been an excellent opportunity to teach them how to share.
We generally try to head off the problem right when it starts. One technique that works really well for us is setting the timer to take turns. Each child then gets 3 minutes with the toy to start, then 4 minutes, and then 5 minutes. Usually by this point they've worked out a way to both play with the same toy. It also teaches them about taking turns, and using the timer defeats any disputes of unfairness.
Sometimes you just have to call in a substitute. See if one of the children will accept a similar toy. This doesn't always work because small children get one thing set in their minds and that is what they have to have. But when it does work, it gives everyone some peace for a little bit.
If nothing else is working, the toy can always go in time out. This usually causes a lot of crying for a time, but children learn that if they can't share, then they can't have what they want. And that encourages them to try harder to share the next time.
Finally, always remember to have your kids hug and make up when they get in fights. We always tell ours that we're a family and we love each other. No matter how angry they may get, hugging each other helps remind them of this.
How do you teach your children to share?