Does he show signs of being feminine? Does he prefer one type toy over the other or is he indifferent?
I think we have come a long way in understanding "being gay". So he may be, however, I wouldn't suggest he were gay because he plays close to another boy. The times have seemed to change from the days of the opposite sex having cooties. My daughter plays with girls and boys and I have never heard her say boys have cooties and the boys aren't bothered by her presence either.
I studied a bit about the make up of a gay person in my anthropology class. There didn't seem to be any real "test" to see why the a person is gay, but more so that a person can be born with a gene or it could as well be environmental (choice). My MIL completely disagrees with the environmental part and believes you can only be born with it.
So are there any gay people in your family that you know of? I am now aware of 3 gay people (2 girls 1 guy) in my family. My family is a bit old fashioned, so it is not apparent when we are together.
With that said, a study was done on a young boy, he was about 4 - 6 years old. He was left to play with what ever he wanted, however had boys toys and girls toys available. He played dress up everyday and twirled and danced around and chose to only play with the dolls. The video never showed him touching a "boy" toy.
So the answer is, you will only know when he is so flamboyant that you can't help but notice or he comes to you and tells you.
A high school friend of mine has an older brother, whom I knew quite well. I never knew he was gay and neither did his family. He never had a girlfriend and always had a roommate who he never brought to the house for dinners. The roommate passed away and the brother changed his beneficiary to one of the sisters. It was a duh moment.
You can't go wrong with teaching personal space, but I don't think you have anything to worry about at this point.