The goal of Capture The Flag is to take the other team's flag (banner) and bring it back to your flag spawn location. After 10 minutes, the team with the most captures wins.
Always have some players attacking and some defending. If you have no attackers, you can't win, and if you have no defense, they will capture a ton and you will lose.
Also, when your teammate picks up the flag, try to defend them, and distract anyone trying to kill them. Similarly, when someone on the other team picks up the flag, do everything you can to stop them. If they are too far away, you can shoot. People have been stopped one block away from capturing.