I used method 2 from here
https://github.com/retropie/RetroPie-Setup/wiki/Setting-up-the-XBox360-controller
So, in my case the lines look something like this:
xboxdrv --trigger-as-button --dpad-as_button --wid 0 --led 2 --deadzone 4000 --silent &
sleep 1
xboxdrv --trigger-as-button --dpad-as_button --wid 1 --led 3 --deadzone 4000 --silent &
sleep 1
xboxdrv --trigger-as-button --dpad-as_button --wid 2 --led 4 --deadzone 4000 --silent &
sleep 1
xboxdrv --trigger-as-button --dpad-as_button --wid 3 --led 5 --deadzone 4000 --silent &
I suggest reading up on how to use xboxdrv, as you can set up multiple controller configurations that you can swap by hitting the xbox button for example. I do that by way of the –alt-config flag and multiple config files. This helps with some emulators that require slightly different controls.
http://pingus.seul.org/~grumbel/xboxdrv/xboxdrv.html