There is a subtle difference between capsizing and swamping a boat. Capsizing involves turning your boat over. Swamping involves filling your boat with water. Usually a capsized boat will result in a swamped boat.
The most common way boats swamp: Under power a boat running with it's bow up then quickly decelerates can cause the wake to overtakes the stern. The effects are compounded in a heavily loaded boat. To avoid this get in the habit of slowing down your boat gradually.
Most small boats will not sink when swamped or capsized. Stay calm and consider these tips:
Take care of yourself first. You can't help your passengers until your situation is under control.
Always stay with the boat unless their is a greater danger such as a dam intakes or waterfall. Be sure and keep everyone together.
If you are in cold water you will need to consider the effects that hypothermia will have on you and your passengers. It's a good idea to get everyone as far out of the water as possible.
Attract attention. Use anything you have to get attention. A bright article of clothing, everyone waving, air horns, whistle or bells. Make a lot of noise. Just make sure there is someone around to see or hear your signal. Otherwise, conserve your energy until you feel you have a chance to be noticed.