Why was neither David nor Solomon stoned to death? David was a murderer and an adulterer. Both crimes were punishable by death under the law of Moses.

Solomon had . . . how many wives and concubines? I don't even remember.

Why was neither David nor Solomon stoned to death? Was there any provision in the law for special cases when the one who commits a crime is the king of Israel?
Solomon married his concubines, so he wasn't practicing adultery - just polygamy, which was not forbidden. 

David murdered Uriah, but did it by proxy. He did not kill Uriah, rather he set up a situation in which he would fall in battle. Beyond that, yes David "killed his ten thousands," but did so in battle, and thus it isn't murder. And as Caleb pointed out, God punished David.