Edited by Snapdragon - 6/17/12 at 6:27pm
He is old enough to learn that his bratty behavior is rude and not acceptable. Talk to him about feeling left out, and explain how you would like him to behave when he feels left out. Then if the behavior continues, there are consequences. You'll have to figure out what sort of consequences work best in your family, but it sounds like right now he is getting what he wants - your undivided attention - by being bratty.
I know what you mean about it being just you and the kid at home entertaining yourselves all day. We have some good friends here, but it's hard to find regular time to get together - I'm struggling to keep my new year's resolution of monthly play dates. So I've found some regular activities we can go to. Once a week we go to story time at the library. We don't see the same people often enough to have made friends there, but it's a fun time to look forward to. Twice a week we go to church where he is in the nursery with other kids - they do see some of the same kids regularly, and the older one at least has made friends that way - and I am in another room, but just down the hall. And the biggest thing is that I joined a fitness group that has childcare at one class a day. I get my exercise, and my kids get to play with other kids and other toys that we don't have at home, but I'm still just in the next room if I'm needed. We usually go 3 times a week, and we see the same kids often enough that my 3-year-old has made friends there.
The church nursery is also where I've connected with babysitters, since I could watch how they interacted with the kids - kids in general and my kids specifically - on a weekly basis, before inviting them to come to our home to babysit. Another thing we've done for dates is to trade with another family - we'll keep their kid while they go on a date one night, and they keep ours while we go out out another night.