You can achieve this in two ways:
1) You can split the booking into two, and then create a invoice or cash receipt for the two bookings separately. This way you can add the name of guest nr 2 on the second invoice.
2) Or you can create two invoices in the original booking. Observe after clicking "create invoice" you have to check or uncheck the boxes for each row in the invoice to avoid charging the same rooms and taxes twice in the two invoices.