Likely cause
The hair thinning and receding hairline seen in the photo are most likely due to pattern hair loss (androgenetic alopecia). This is a common type of hair loss where the hair follicles gradually become thinner and produce finer, shorter hairs, usually starting from the front and top of the scalp. It tends to progress slowly over time and can run in families. A dermatologist can confirm this by examining the scalp.
What to watch for
Keep an eye out for sudden or very rapid worsening of hair loss, round or clearly defined bald patches, or scalp symptoms such as severe itching, redness, pain, swelling, scaling or pus. Also tell your doctor if the hair loss started after a major illness, significant weight loss, poor diet or a new medicine.
What you can do
Since this has been going on for about 2 years and the hairline is also receding, it would be useful to see a dermatologist rather than waiting for it to progress further. The doctor can examine the scalp and hair roots to confirm the cause and check whether anything else is contributing to the hair loss. Avoid very tight hairstyles, frequent heat/chemical treatments and harsh hair products. Maintain a balanced diet with adequate protein and avoid crash dieting.
When to see a doctor
A dermatologist should be consulted because the hair loss has been persistent and is gradually progressing. Earlier evaluation is especially important if the hair loss suddenly becomes much worse, occurs in patches, or is accompanied by redness, pain, severe itching, scaling or scarring of the scalp. Early assessment is useful because some types of hair loss are easier to control when treated early. Also long term treatments are required for hair loss, so don't drop any treatment without letting your dermatologist know.
This is general information from a verified doctor and is not a diagnosis or a substitute for an in-person consultation. In an emergency, seek immediate medical care.