A message saying, "The maximum number of free accounts have been activated on this iPhone" or, "This iPhone has been used to create/setup too many new Apple IDs" is discussed in the support document: "If you see a Could Not Create Apple ID or Could Not Set Up iCloud message." Click on this link to read it. --> https://support.apple.com/HT210743
This message generally means that you have exceeded the number of Apple IDs you can set up with iCloud, or create as new IDs, on a single device in one year. See the recommendations in the link on alternative methods for setting up iCloud accounts, e.g. on a computer, or contact Apple Support if requested:
Click here --> https://support.apple.com/choose-country-region Select your country, then a product. If you don't see one that handles your issue then keep experimenting with selections until you reach one that gets you a chat session or a telephone call and get the representative to redirect you.
or:
Contact Apple for support and service --> "See a list of Apple phone numbers around the world."
Click here --> https://support.apple.com/HT201232
HOWEVER, your best solution is to just try to recover the information for your old ID:
Click on this link to read what to do "If you forgot your Apple ID" --> https://support.apple.com/HT201354 Note that typically this is an email address you use.
Click on this link to read what to do "If you forgot your Apple ID password" --> https://support.apple.com/HT201487
or go directly to this link --> http://iforgot.apple.com/
Also read about "What to do after [or before] you change your Apple ID email address or password" - https://support.apple.com/HT204071
If you still need help:
Contact Apple for help with Apple ID account security "This article provides country-specific Apple Support contact information for customers seeking help with their Apple ID password or other security-related issues."
https://support.apple.com/HT204169