blockchain – How many addresses can be in input and output of a transaction

I have read through this question and i understand that there can be many sender and receiver addresses within 1 transaction(i’m new to bitcoin transaction, previous i was working with ethereum where 1 transaction can only have 1 sender and 1 receiver).

I’m working with blockcypher api endpoint to monitor incoming bitcoin to an address. I need to get all the possible number of address that can happen in input or output.

Here the logic of my monitor system, user can input their addresses to send(save in database), and my system also has an address to receive that amount. The monitor system only detect the incoming transactions to my address from the user addresses in the input addresses (exists in database)

I have categorized it into these to know the correct value that was send to an address:

input | output  | incoming amount to address
1     | 1 or 2  | amount show on receiver(output) of my address
1     | >2      | amount show on receiver(output) of my address
>1    | 1       | amount show on sender(of the system)(input)

Now i need to know can there be more then 2 on the input and more than 2 on the output? i haven’t found any example of it yet

Also please tell me if my monitor logic is correct, are there different logic to monitor incoming bitcoin transaction to an address?

Thank in advance

Sorry if i mess up somewhere in my question, i’m pretty new to bitcoin system.