I need to install macOS high sierra but i need to know the data will be erased or not and what is the way to install it without lose data.
Generally speaking, your can "upgrade in place" meaning High Sierra will install, upgrading your old version of macOS while keeping your data intact.
However, you should back up your data. This is the very first thing Apple says to do after checking that the upgrade is compatible with your machine.
Before you upgrade, we recommend that you back up your Mac. Then, if your Mac is running OS X Mountain Lion 10.8 or later, you can upgrade directly to macOS High Sierra.
Upgrades should go without issue, but things happen. For example, the upgrade could be interrupted for any reason beyond your control thus, compromising your data.
Additionally, High Sierra will convert your HFS+ file system to APFS on the fly meaning you're converting file system that "holds" your data. This introduces another level of complexity increasing the chance for failure.