If there are any claimants then the claimant with the strongest claim gets the kingdom. If there are no claimants then the largest contributor to the Crusade gets the Kingdom. Contribution is mostly determined by how many troops you kill and lose with sieges playing a negligible part...so, to get the highest contribution score you want to hunt down enemy armies and leave sieges to your allies until most of the enemy armies are destroyed.