OCD or obsessive compulsive disorder is an extreme anxiety disorder. This is where anxiety will build in a person and it can only be relieved if they do something in a certain way or ritual. For instance one person might wash their hands three times and if they are prevented from doing this they may get extremely anxious and in some very extreme cases the person may even become psychotic.
When looking for OCD in someone take notice to see if there are things that must be consistently done in only one way. Although a lot of people may have their own right or wrong way those with OCD are far more rigid that we would be. For example the person with OCD when cleaning the bathroom may always have to do the tub first, the sink next and the toilet last. Now if someone else goes in and starts with the toilet first and so on, the OCD person will have to go back in after them and clean it again their way.
Make sure to look for a lot of repetition. Some people that have OCD will have to do certain things for the same number of repetitions. For instance if they have the need to check the deadbolt to see if it's locked and they might do this for three times each time. The can't rest until they do this task exactly the amount of time they do it each time.
See how the person acts if they are not allowed to complete their ritual. If they become very agitated because they were not able to complete their ritual like washing their hands or checking that deadbolt three times, then there is definitely something wrong.
People who have OCD will also tend to hoard particular items. So you need to notice if they are hoarding things. An example would be a woman carrying 30 pens in her purse at all times or someone that saves every receipt from everything they have ever done in say the last 20 years. If you try to throw any of the excess away the person with OCD is going to immediately get extremely agitated when you try to do so.
The underlying anxiety is what needs to be uncovered. Because it's the anxiety that fuels the OCD. The person is extremely anxious about something and the only way to relieve that anxiety for a while is to do one of their rituals.
It's probably a good idea if you discover a friend or family member might have OCD and suggest that they go see a therapist. A good therapist will be able to see if they really do have OCD and they more than likely will be able to get to the underlying anxiety as well and hopefully be able to work with the person to eventually relieve them of their OCD issues.