How to Stop my iPhone from locking?

My friends always take my phone and lock it and its really annoying. I want to have a pass code but I don't want it to lock me out, is there a way I can do that?

I don't think so. But put it on the setting that if they guess it wrong more that 10 times it will erase all data, if you tell them that they won't do it. Xxx

You can add a pass code by going to settings > general > Passcode lock