After login I get a black screen, if I connect a external monitor with HDMI it works in the external monitor. If I go in safe mode, the screen of the macbook also works. I already format the HDD and reinstalled IOS High Sierra and I still have the problem after login.
If your computer works fine in Safe Mode that's an indication that maybe an extension or a startup item may be the culprit. If you've loaded a new extension try removing it and restarting and see if that works. After that, remove all startup items by going to System Preferences/Users & Groups and clicking on the Login Items tab at the top of the panel. Now select each startup item and remove each one by clicking on the minus sign under the app's part of the panel. After removing all login items, restart the machine in regular mode and see if it works.
If it works fine after removing the login items you can put them back one at a time and see which one causes your problem.