Hi user5787,
Face ID can often unlock extremely quickly.
If you were looking at your iPhone before giving it to your friend, it is possible it may have already scanned your face and been unlocked.
We can recommend locking the phone, ensure the screen is off and then see if they can unlock it or are prompted for a passcode.
If your friend can still unlock it, we'd advise resetting Face ID as outlined in Step 8 here: If Face ID isn't working on your iPhone or iPad Pro - Apple Support.
This removes all the learning Face ID has done on your face, and sets the feature back up from scratch. After that, ensure you can unlock it and they cannot.
Should you have additional questions or if they can still unlock it, then contact Apple Support.
Take care.