How to add google recaptcha on a custom form

the code is worked but when submit the form it’s show 404 error how to solve the issue