surname: {{#if:<!--has three words-->{{#explode:{{{name}}}| |2}}|<!--show third word-->{{#explode:{{{name}}}| |2}}|<!--has less than three words-->}}
+
surname: {{#if:<!--has three words-->{{#explode:{{{name}}}| |2}}|<!--show third word-->{{#explode:{{{name}}}| |2}}|<!--has less than three words show the second word-->{{#explode:{{{name|}}}| |1}} }}