Installing OneDrive on Windows Server 2012 R2 can be challenging due to the operating system's end-of-support status. While the OS officially supported the sync client in the past, modern production installers often fail. Official Installation Method
Also disable OneDriveUpdaterService :
Do not rely on OneDrive sync on Windows Server 2012 R2 in production. Upgrade or migrate to a supported synchronization solution. onedrive download windows server 2012 r2 exclusive