I planted a very small fig tree - brown turkey - 2 years ago. It has made good growth but not flowered/fruited. It is planted confined by paving slabs next to a wall in a sunny position.
It may be a nitrogen/phosphorus imbalance in the soil. Too much nitrogen and too little phosphorus can result in little to no blooming, which means no fruit. This article should help: https://www.gardeningknowhow.com/edible/fruits/figs/fig-tree-is-producing-fruit.htm