When starting a race, you have to use a specific way to begin called the forward start.
In a freestyle event, you can swim any way you want, except in a medley relay or an individual medley event, freestyle means any style other than butterfly, breaststroke, or backstroke. You have to keep some part of your body above the water during the race, but you can go underwater for a short time after the start and after each turn. By the time you reach 15 meters (about 16 yards) from the start and each turn, you have to have come up to the surface with your head.
When you reach the end of the pool, you have to touch the wall with your hand.
You finish the race when any part of your body touches the wall after you swim the required distance.