@allan which version of Android are you using?
In Marshmallow (6.0), you can go to Settings | Accessibility.
Turn on "Switch Access". Go to SETTINGS there.
Select "Assign Keys to Actions".
There you can assign any key combination to Back and Home buttons.
Other versions of Android have similar functionality.
Let us know if this works for you.