RetroPie
RetroPie is a native operating system based on emulationstation, which houses a multitude of legacy gaming console emulators.
Installation
You can download the RetroPie image here. Once downloaded, you can install the image to your SDCard via dd in linux, for example:
$ gunzip -c /home/gr0x0rd/Downloads/retropie-4.1-rpi2_rpi3.img.gz | sudo dd of=/dev/sdg
Once the dump is complete, insert the SDCard into the PI and fire it up. Eventually you will arrive at the main RetroPie screen.
Configuration
RetroPie will ask you to configure and input device. The operating system is designed to work with a gamepad, so that configuration is recommended (if you are using a PS3 controller, connect it via USB). Hold down a button to start the configuration process. You can also configure your keyboard by holding a button for a few seconds. It would be advisable to use the corresponding arrows for left/right/up/down, enter for start, b for b and a for a.
A note on navigating through the RetroPie menus: on the GUI based screens, the "A" button is the same as "enter" or "ok". The "B" button is cancel. The "Start" button brings up the RetroPie menu which allows you to configure controllers, quit or what have you. To get to advanced features, you'll need to select the RetroPie option and press A. Choose "RetroPie Setup" and press A. The console menus that now appear need to be navigated with the analog stick as opposed to the directional pad, and the select button is now the "ok" button as opposed to the A button.
PS3 Controller
If you have a bluetooth PS3 controller, this sadly won't work using its wireless connection out-of-the-box. You will need to press start to access the main RetroPie menu, then choose "RetroPie setup". Choose "Manage Packages", then "Manage Driver Packages". Install the PS3 controller driver. When done, choose the configuration option and connect a USB cable from the controller to your RetroPie install, if you haven't already. Disconnect the USB cable and press the home button on the controller. It should now be working.
Kodi
Press A after selecting the RetroPie menu, then choose "RetroPie Setup" and press A. Choose "Manage Packages", then "Manage Optional Packages". Scroll down to Kodi using the analog stick and press the select button. Kodi will now be installed.