Here is what i do. I run a 4-player cab with player position going 1,2,3,4. And with 2 or 3 player setup my controls go 3,1,2,3. With that setup i have my player 1 and 2 in the center of cab and for those few 3 player games (Battletoads,Double Dragon 3 etc..), they can play on either side. This is how i do it.
1) set up 2 mame emulators specific for 2 player cab and one for 4 player cab. (I just put those in the launchbox/emulator folder, I can't remember if that folder was there already or if i had to create it myself)
2)set up your controls in both emulators as you normally would.
3)add those emulators to your launchbox. I believe its in tools>manage emulators. also don't check or say yes to make those your default arcade emulators, we will handle that later.
4)assuming you have your playlist categories setup from adding your roms in, go to playlist categories and you should see "2 players" and "4 players"
5) start with 2 player but you can also just do this to All arcade games as well so make your single player games are set on the same mame setup as your 2 player. But select either 2 player or all arcade games, and select all the listed games *Ctrl+A* (to make this easier to do i change the view to just "list") right-click the highlighted area and select "Bulk Edit"
6) You should have a wizard screen pop up and a pulldown bar. click the bar and scroll to emulators, and set "value" to your mame running 2 player setup. and that is it for 2 player or All games if you choose that method.
7) 4 players repeat same process, goto 4 players in the playlist categories, select all games,right-click,Bulk edit, except this time pick the mame set for 4 players. and that is it.
After that the games will automatically go to the mame setup for the choosen roms.
Side note, some 4 player games will not out the gate be set to 4 players or 3 players to 3. I think one of the Capcom D&D is this way and BattleToads as well. but fix is simple, just "tab" your keyboard to goto the menu and change the dipswitch to 4players from whichever it was set to.
Hope that helps some.
This can also be done with FBNeo pretty much the same expect it requires a different kind of tinkering in the controls section for retroarch.