You should just make a remote.xml file with your custom actions in ~/.kodi/userdata/keymaps/
for example this is mine:
<keymap>
<FullscreenVideo>
<remote>
<zero>AudioNextLanguage</zero>
<seven>subtitledelayminus</seven>
<nine>subtitledelayplus</nine>
</remote>
</FullscreenVideo>
</keymap>
So keypress 0 on my remote is next language, 7 is subtitledelayminus. Just follow the kodi wiki about keymaps: Keymap - Official Kodi Wiki
If I remember correctly only the <remote> actions will work with a ir-remote.
A while ago there where problems with ir-remotes on amlogic devices and then the guys of coreelec had set the ir-remote in keyboard mode so the remotes should work, but I don't know if you can do that through configuration or you should rebuild libreelec with this option.