What happens with the transactions a miner didn't include in a block? Let's say a miner pulls from the node the available transactions to be included in the next block. He receives transactions A, B and C. For whatever reason he discards transaction B and so he mines a block that includes only A and C. Meantime, before the miner pushes the new block, the node has received a new transaction D.

What happens with the transactions B and D? I suppose the node verifies which transactions were not included in the mined block and keeps them available for the next block, is that correct?
Transactions A,B,C will be validated and added to the miners memory pool just like any other node does. If A and B are the only ones added to the next block then c will remain in the memory pool and will later be joined by D. So C and D will remain in the memory pool until they are added to a new block while A and B will form part of the new block. If the miner is successful in solving the proof of work then his block will be propagated to other nodes and if it is accepted it will added to a chain. When the miner receives a new block from the network, then the software does check if the new block has transactions that are in its memory pool and will remove any transactions from the memory pool if it is in the new block.