While OneDrive can be installed on Windows Server 2012 R2, there are some limitations and considerations:
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive" -Force Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive" -Name "FilesOnDemandEnabled" -Value 0 -Type DWord
Even with the exclusive method, you may encounter issues. Here is the definitive fix matrix:
: As of January 14, 2020, Microsoft 365 Apps are no longer officially supported on Windows Server 2012 R2.