How bitcoin protocol checks transaction is valid (in particular that inputs are unspent)?
Yes, you've basically got it.

Regarding multiple outputs, the solution is quite simple.  Your input, instead of just specifying a transaction to spend, instead specifies a particular output of a transaction.  So instead of your input saying "I am spending transaction abc123", it says "I am spending output #2 of transaction abc123".

Every full node on the Bitcoin network maintains a database of unspent transaction outputs or UTXOs.  It is indexed by transaction ID and output number.  So when a node sees your transaction, it will mark transaction abc123 output #2 as spent.  Outputs #0 and #1 of that same transaction have their own independent entries in the database and so their states are unchanged; if they have not been spent previously, they can be spent by some later transaction.