How do you know a boy likes you or is going to ask you out?

you can see if a boy likes you if he stares at you or tries to come close to you or join in when your talking with your friends. maybe he would chat to you and say stuff to you like "your hair looks nice" " lukin good today" and other thing like that. then he suddenly asks you. If you dont like him its better to stay away as if you keep talkin to him and all that he will think you are gettin closer to him and then ask u out.