How to completely remove homebrew?
Use this script to uninstall homebrew completely. It's safer to run each command separately, especially the cd `brew --prefix` to check if it suceeds.
From the homebrew FAQ:

How do I uninstall Homebrew?
If you installed to /usr/local then you can use the script in this gist to uninstall — it will only remove Homebrew and the stuff Homebrew installed leaving anything else in /usr/local alone.
Provided you haven’t put anything else in Homebrew’s prefix (brew --prefix), you can generally just rm -rf that directory. This is because Homebrew won’t touch files outside its prefix.