When logging a payment for a guest with multiple unpaid bookings, the payments are automatically allocated in the order of the guests' arrival dates.
To log a payment for the guest, navigate to Guests -> Individuals, click the three dots under Actions, and select View. On the opened page, click the Log Payment button located at the top right of the Payments card under the Balance tab.