The transactions included are determined usually by their priority, which is also determined by the fee. Large transactions are typically high priority as well as transactions with a decent fee. I think the software will pull the transactions with a high enough priority first and include those in the block. Also, part of the block is a thing called the merkle root, which is a hash of all of the transactions included into the block. In order to change the hash in different ways besides the nonce, different transactions will also be included to change the merkle root. Generally, block sizes are determined by how quickly the miners exhaust nonces and how many transactions with decent fees can be stuffed in.