You cannot use Spell Combat with a two-handed weapon
According to Spell Combat:
To use this ability, the magus must have one hand free (even if the spell being cast does not have somatic components), while wielding a light or one-handed melee weapon in the other hand.
The moment your hand is no longer free, you cannot use Spell Combat. Spell Combat only works while you have a free hand (to cast the spell) and a one-handed (or light) weapon in your other hand, which will deliver the attacks. Otherwise, you are breaking the action economy by casting a spell as a free action (instead of a standard) and then making a Full Attack instead of using Spell Combat.
This has been clarified in a FAQ, you have to use a light or one-handed weapon with Spell Combat, not natural weapons, not unarmed attacks, not two-handed weapons:
When using spell combat, do I specifically have to use the weapon in my other hand, or can I use a mixture of weapons (such as armor spikes and bites) so long as my casting hand remains free?
You specifically have to use the light or one-handed melee weapon in your other hand.
The moment you switch to two-handed, the requirement is no longer met and you cannot deliver the spell using your weapon anymore.
Finally, this also has been clarified to not be the design intent (rules as intended) for the magus class by Paizo's Creative Director, James Jacobs:
James, a PC of mine wanted to know if the weapon limitations of a Bladebound Magus were for fluff or game balance? (Context : He wanted to have a greatsword as his Black Blade)
That's a Jason question... but overall, magi do not use two-handed weapons. They need to keep a hand free for spellcasting—they're not "fighter/wizards" as much as they are two weapon fighters who just happen to use spells as their off-hand weapon. So two-handed weapons are nonsensical in most cases—the staff magus is the only one I know of that breaks that rule.
Do note that the Staff Magus he mentions actually wields staves as one-handed weapons, due to the Quarterstaff Master feat gained at first level, which says:
By employing a number of different stances and techniques, you can wield a quarterstaff as a one-handed weapon. At the start of your turn, you decide whether or not you are going to wield the quarterstaff as a one-handed or two-handed weapon. When you wield it as a one-handed weapon, your other hand is free, and you cannot use the staff as a double weapon.
So, if you figure out a way to use your desired weapon one-handedly (example: Titan Mauler archetype), you should be fine. Otherwise, you cannot combine Spell Combat with it.
But you can use Spellstrike with a two-handed weapon
Spellstrike, on the other hand, has no requirement of a free hand to deliver the touch spell, and according to this FAQ, it doesn't change how delivering touch spells work, it simply grants you another method of delivering them.
Can a magus use spellstrike (page 10) to cast a touch spell, move, and make a melee attack with a weapon to deliver the touch spell, all in the same round?
Yes. Other than deploying the spell with a melee weapon attack instead of a melee touch attack, the magus spellstrike ability doesn’t change the normal rules for using touch spells in combat (Core Rulebook page 185). So, just like casting a touch spell, a magus could use spellstrike to cast a touch spell, take a move toward an enemy, then (as a free action) make a melee attack with his weapon to deliver the spell.
On a related topic, the magus touching his held weapon doesn’t count as “touching anything or anyone” when determining if he discharges the spell. A magus could even use the spellstrike ability, miss with his melee attack to deliver the spell, be disarmed by an opponent (or drop the weapon voluntarily, for whatever reason), and still be holding the charge in his hand, just like a normal spellcaster. Furthermore, the weaponless magus could pick up a weapon (even that same weapon) with that hand without automatically discharging the spell, and then attempt to use the weapon to deliver the spell. However, if the magus touches anything other than a weapon with that hand (such as retrieving a potion), that discharges the spell as normal.
Basically, the spellstrike gives the magus more options when it comes to delivering touch spells; it’s not supposed to make it more difficult for the magus to use touch spells.
As such, a magus wielding a two-handed weapon could do the following:
- Free: Switch to one-handed.
- Standard: Cast shocking grasp;
- Move: Approach enemy;
- Free: Touch attack with held spell;
- Free: Switch to two-handed.
But you may also check with your GM if that's ok, as the number of free actions you can take in a turn, according to this other FAQ, is entirely GM Fiat:
"Free actions don't take any time at all, though there may be limits to the number of free actions you can perform in a turn."
In other words, the GM can allow more or fewer free actions as appropriate to the circumstances.
You may also make a Full Attack with a held charge
According to the FAQ I mentioned previously, holding your weapon or changing grips won't discharge the spell either, so you could cast the spell in one round, hold the charge for the next round, then change your grip and make your Full Attack normally.
But this is certainly not optimal, and you would deal far more damage by wielding a one-handed weapon and making two full round of attacks. However, if you happen to have missed all of your attacks, or got your Spell Combat action interrupted by something, keep in mind that you may switch your grip on your next action and deliver your full sequence of blows which will also discharge the held spell.