A cat will often rub their face and body against an object or person in order to mark it with their scent. However, this can also be a greeting or a sign of affection. A friendly greeting between cats is the touching of noses, and this is often followed by the cat rubbing their cheek against your face. If you are standing up, your cat may rear up on his hind legs in order to have his face stroked. It is thought that this is because your face is too far away for them to rub against it in greeting and so they are helpfully lessening the distance.
Rubbing their bodies against your legs is also a good way of reminding you how lovely and affectionate they are when they want to be fed! This behaviour can, at times, be a little trying and they are also rather good at tripping you up by trying to run between your legs, but try not to be too angry as it is meant with affection.
Kittens instinctively kneed their mothers tummies to stimulate the production of milk, and it is thought that this may be the origin of the kneading motion (also known as padding) which they often use on humans before settling down to have a nap. It is also likely that their kneading helps to make humans and/or cushions more comfortable although many cats seem content to stretch out over items which do not took at all comfortable (no doubt because they are protected by their lovely soft fur) so they do seem to be able to be comfy almost anywhere! A cat may also paw at an object or a person to mark it as their as they have small glands on the underside of their paws which release a small does of their scent.