Good try, but neither of those commas is correct.
A mighty king disguises himself as a peasant to search for a maiden who will fall in love with him for who he is and not just for his kingdom.
The middle of the sentence is awkward and may improve with changing for who he is to for himself.
FYI, peasant is not Middle-Ages Speak for person who isn’t royalty/nobility. An actual peasant wouldn’t have the freedom to just travel around wherever they liked, whenever they liked, much less marry whomever they chose. This example would work better if that word was changed to commoner.
(In the latest episode of Never Trust the Spell Check, we see WordPress say that marry is spelled incorrectly. It recommends merry instead, ’cause yeah, that’s a verb… Not. *shakes head*)