By default, configuring the keyboard from EmulationStation will configure it as P1, if you wish to make the keybord work as P2, then you'll need to manually modify the retroarch.cfg configuration file for RetroArch and replace the player # in the bindings, i.e.
input_player1_a="X" input_player1_b="Y" ... #etcwith
input_player2_a="X" input_player2_b="Y" # and so forth