There are many different reasons why a lemon tree might not be producing fruit.
First, ensure your tree receives ample sunlight, as lemon trees thrive in full sun. You also should protect it from strong winds and extremely cold temperatures, as they can hinder fruit production.
Adequate watering, especially during dry spells and flowering, is also crucial to promote fruit set. And regular feeding during the growing seasons of spring, summer, and autumn is essential, as lemon trees have high nutrient requirements.
Pruning should be minimal, and restricted to mainly controlling height and removing any dead or affected branches. If you prune and there wasn't enough time for the plant to produce new growth over the warming months, then you've likely set it back for a year.
We have also previously seen on Workshop examples from members where grafted trees have suffered from rootstock taking over. Normally a tree should have a singular trunk that branches off well above the soil. If you have many smaller branches coming from the soil like the picture above, that is a good indication the branch structure is coming from the rootstock (below the graft line) and no fruit will ever be produced from these branches. Rootstock typically grows vigorously but does not bear fruit or only in limited quantities. If it does bear fruit, it's generally seed ridden and not palatable. Another key detail to look for to indicate rootstock is huge thorns - citrus varieties these days don't have huge gnarly thorns.
Finally, be vigilant for pests and diseases that can affect fruiting, such as citrus leaf miner, citrus gall wasps, scales, and others. Identifying and addressing these issues promptly can help restore fruit production.
Do take care with pruning citrus - this can sometimes encourage the trees to bear good crops only every second year as they put their efforts into growth immediately after a hard prune, rather into regular flowering and fruiting. Biennial bearing is a common problem when citrus are pruned after a good crop. - Noelle