You can learn more about Face ID here: https://support.apple.com/en-ie/HT208108
It is possible that Face ID might unlock the device for you and your friend if two of you have similar look. Face ID constantly learns how to recognise you. It's doing this each time you are prompt for passcode and correct passcode is entered to unlock the device. So if your friend knows the passcode for your iPhone and successfully has unlocked the device, then Face ID has learned how to recognised his/her face too.
Reset Face ID settings and change your passcode so your frien no longer knows it. Then see if he/she can still unlock it.
If someone ask you if they could use your iPhone, unlock it first. You should not share your passcode. If other person knows your iPhone’s passcode too, then you have more things to be worry about it (e.g. that other person would have an access to all your saved passwords).