What version of retropie are you using? I’d suggest using retropie 3 beta 4 as it has a lot of fixes regarding controller configurations. (The emulation station configuration will also configure retroarch for you)
Reply To: USB Gamepad works in Emulation Station, but not in Game properly