I just followed this guide.
https://github.com/RetroPie/RetroPie-Setup/wiki/PS3-Controller
Here are the steps I did (copied from the guide)
Navigate to the "RetroPie" icon in the Home Screen and select it using whatever key you mapped "A" to on your gamepad, and go to RetroPie Setup
Once in the RetroPie GUI, choose [Manage packages] > [driver].
Select PS3 Controller Driver ("ps3controller"), and then select [Install from source].
Once installation completes, exit RetroPie setup and return to the EmulationStation Home Screen.
Press "Start" to enter the EmulationStation Menu, and select Configure Input.
Disconnect your PS3 controller from USB. Now hold the PS button on the controller down until you see the lights on it flash sequentially. The controller should now be connected via Bluetooth.
Emulation Station should now detect another gamepad connected. Hold any button down on the controller to begin configuring it.
The part that is bolded is the part that is not working. My remote was plugged in for an hour so I know it has charge. It just flashes but doesn't actually connect at all.