The goal of Capture The Flag is to take the other team's flag (banner) and bring it back to your capturing location. This location is often at your own team's flag, but can be somewhere else too. After 10 minutes, the team with the most captures wins.
If teams have the same amount of captures, the team closest to capturing the next flag wins. This is done using Flag Proximity which can be seen as small numbers in the scoreboard.
The number shows how close the team was to capturing the flag, so the lower the proximity, the better.
On most maps you can buy useful items using /shop. The currency for this shop is Ingame Coins, which can be obtained by capturing flags, killing players and a higher CaptureTheFlag level.
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 before, you can do it too.