Transaction inclusion into block What are reliable and good sources for understanding the procedure of transaction inclusion into a block?

Problem outline:
Given, there are multiple peers - let's say 5 - in a test network, where 3 nodes exchange transactions - let's say 100 - and 2 nodes include all transactions into blocks.
Which node decides how to include which transaction into which block?
Every node maintains a memory pool of transactions that are not yet accepted into the block chain, but they consider acceptable. The rules for this acceptability are complicated (they must be valid, they must not spend any coins already spent in the chain or by anything already in the mempool, various limitations to prevent denial of service attacks, fee and priority limitations, rate limits, ...). Any time a miner creates a new block, they generally use all available transactions from their mempool, constrained by block size limitations (so some transactions may not make it into one block, but could make it into the next one).