Goo day, davidkeighley-dk.
QuickBooks uses both amount and transaction dates when looking for a match. It will become a "Match" if they have the same amount and the transaction date is within 90 days.
If you're trying to match a single deposit to multiple invoices, select all the check boxes of the matching transactions. Then, verify if the total amount is the same as the downloaded transaction.
To give you more details on how QuickBooks finds a match, please see this article: Add And Match Downloaded Banking Transactions.
I'll look forward to your reply if you have other questions. I'll be around to help you again.