Can someone jailbreak my iphone?

Nearly three years ago I had spent the night with some friends. I had just gotten an iPhone and prior in the day I had let them do the fingerprint thing. I forgot about it. I fell asleep before the two friends who had their fingerprints, so they used my iPhone while I was asleep. I looked at the thing that shows what apps have been used that you can clear out and of course since it has been so long I can't remember exactly what apps, but it looked like they went through everything. They changed my wallpaper and stuff like that. I didn't think much of it because I didn't think they did it to be malicious and I still don't think that necessarily. They had access to my phone for hours. Also since it was new, I don't know if I would notice if there was a change in how the iPhone operated. Two years after this my phone had been broken due to being dropped multiple times, I factory reset it before it completely went just because I didn't know whether or not it would be sent somewhere to get it's screen fixed. So I don't have the data that used to be on that phone. How likely is it that they could have jailbroken it and installed something to spy on me? I don't think I ever manually searched for Cydia or anything like that. I'm paranoid now thinking that they could have possibly been spying on me.

So if they did what can you do about it now?

It would only be possible if a jailbreak was available for the version you were on at the time. If you were on the latest version then the answer is no

Even if they did, any firmware updates you did after then would've broken it as jailbreaks exploit the firmware, those exploits are patched by Apple through updates.

Also jailbreaks are not exactly secret unless they made it themselves (highly doubt it) you would have a couple of apps on your device, main one being Cydia and then the app that was used to jailbreak (Pangu, Yalu, Electra for example) also you'd have to re-jailbreak every time you rebooted your phone as untethered jailbreaks aren't really a thing anymore