If the bride and groom are invited on the invitation, you can write their names in the "invitation place", such as "Invited by the bride/groom XXX, the bride/groom XXX".
If the invitation is a personal invitation of the groom or bride, you can write the name of the inviter in the "invitation", such as "groom XXX invitation" or "bride XXX invitation".
In short, whether to write two people's names on the invitation depends on the specific situation.