about"Cannon in C major"

This is generally the case, C G Am Em F C F G

But this is often the case.

Like this G becomes G/B, how should I master it, how do I know when I need to become G/B?