While some of what you say seems to hang together, I am not getting a clear picture. Simply using a laptop is not going to lock devices to his account, particularly if you did not sign out of your account first. The only thing I can think of is you let him know your account password and then he changed that. But surely it wouldn't have taken you "years" to discover that?
To lock a device to an account the person has to sign in on the device itself. Signing in on the laptop is not going to lock the device to his account. Him changing your password could result in the message you see because it is now locked to your account to which you no longer have access. You may or may not be able to regain access to that.
Read this document if you think your Apple ID has been compromised. --> If you think your Apple Account has been compromised - Apple Support
For iOS 15 or earlier, if you want to see if anyone else has access to your device or accounts, click here --> Checklist 1: Limit device and account access - Apple Support
For iOS 16 or later see how Safety Check on iPhone works to keep you safe. Safety Check for an iPhone with iOS 16 or later - Apple Support
Use the information in this document to check your Apple ID device list to find where you're signed in --> Check your Apple Account device list to find where you’re signed in - Apple Support
Related materials:
Personal Safety User Guide
Personal Safety User Guide - Apple Support
> open the Table of Contents and review the articles
A document with general information about security and your Apple ID --> Security and your Apple Account - Apple Support
Contact Apple for help with Apple ID account security. This page provides country-specific Apple Support contact information ➞ Contact Apple for support and service - Apple Support
As for the "locked to owner" thing, you can get Apple to reset the device if you still have the original receipt for it, but they will completely erase the device, plus it won't get your account back for you.
Apple can completely reset a device if a person can provide sufficient evidence of valid ownership. Check the requirements and steps at: Activation Lock support request - https://al-support.apple.com/#/additional-support Apple says, "Proof of ownership documentation is required," but does not detail what currently constitutes proof other than it “must include the product serial number, IMEI or MEID.” Apple may typically require the original receipt* issued by Apple or an Apple Authorized Reseller. If Apple resets the device this will give you access to the device but won't restore access to the account used to lock it. There is nothing that can be done to expedite an Activation Lock request.
*Apple recommends you "Keep your receipt after you buy an Apple device" --> Keep your receipt after you buy an Apple device - Apple Support