“Only have sex inside marriage”
Solomon , also called Jedidiah (יְדִידְיָהּ, Yǝḏīḏǝyāh), was, according to the Hebrew Bible and Christian Old Testament, a fabulously wealthy and wise monarch
wanted and had 300 wives and a few extra concubines too.
Probably he did not share though
Yes, and he was punished for that, even beyond the division of his kingdom after his death.
According to I Kings 11.3, Solomon had 700 wives and 300 concubines.