How to make a custom subdomain


can someone help me in this case?

I have below things:

Main domain:
Sub Domain for Backend Link:

What I am looking for is.

username.domainname .com should redirect to login.domainname .com where username can be a user who wants to log in. This is Business to Business Application.