How to know if a guy is into you or just for sex

I really want to know the difference how do you know if a guy is just after sex or if he actually wants a relationship