...
The Server has to be part of the target Active Directory Domain
The Server Role “Active Directory Federation Services” has to be installed and configured on the server.
The three parts “Install a server SSL certificate”, “Install the AD FS server role” and “Configure the federation server” under Step 2 of this the Microsoft documentation are quite helpful here.
...