A group of young boys wearing track jackets stretch their legs on a gym floor as they sit in a circle.
There are boys in the gym.
On a gym floor implies in the gym.
There would be boys in the gym if they are stretching on a gym floor.
If the boys are on the gym floor they are in a gym.