As the Bodhisattva had to leave his wife and son behind to become the Buddha and as the monks do a similar thing (avoiding marriage etc), I would like to know if this is some kind of precondition to enlightment, if a being needs to stay away from his family for a while and avoid new karmic bonds (marriage/children) in his way to enlightment.
The short answer is Yes. Because enlightenment depends on neither external physical attributes, actions and circumstances nor knowledge and skills and even siddhi, but inner peace that one brings into the world. One's ability to be happy in every little moment and in every new things happening around and personally in one's life is important. Being in the very centre, in the heart of life, doing everything, whether it is work, family or spiritual service; it's needed to keep staying not involved at the same time.
Not involved, in terms of not to be completely self-identified with these circumstances in order to keep clean mind, soft heart and good mood always. It's easier to do this when one is sitting in the cave alone, and it's harder and challenging, and that's why is more valuable, living in the big city. We're born as humans, and humans live in society.
According to my understanding there are four stages of enlightenment.
So It is quite possible that a normal person can attend the Sotapatti state with the normal life style. In fact there were lot of lay people who attended these stages. Found this wiki page with lot of information about enlightened lay people according to various Suttas.
some kind of precondition to enlightenment?
The only thing I think of is as lay Buddhist; Pāramitā
In Buddhism, these virtues are cultivated as a way of purification, purifying karma and helping the aspirant to live an unobstructed life, while reaching the goal of enlightenment.
In Jātaka tale (whether you want to believe it or not), there are many example of Buddha past life as normal human living with family and still fulfilling Pāramitā to attain enlightenment, and which is also true for many Buddha's disciples. The only story I can find for Pāramitā related Jātaka tales is Vessantara Jataka
From my Theravada understanding:
Another example is Visakha known to have a lot of great grandchildren. From page 981 of The Princeton Dictionary of Buddhism
For Anāgāmi, they will never live as husband/wife
For Arahant, they will never stay with family.
Anāgāmi - already overcome sensual desire (kāmacchando) fetter
Arahant - who has eliminated all the unwholesome roots which underlie the fetters.