These two preposition may sometimes be confused because they often translate the English preposition 'in'. However, they have slight differences in meaning:
DANS when is referred to a PLACE means 'inside'
e.g. Il dort dans ma chambre.
DANS when is referred to TIME means 'during'
e.g. Dans ma séjour en France, j'ai visité ma tante.
DANS when is referred to TIME means 'after a certain time has past'.
e.g. Je vais terminer ce course dans 10 jours.(10 days from today)
EN when is referred to TIME outlines the 'duration' of something:
e.g. Nous sommes arrivés à sa maison en trois minutes.
EN also refers to the seasons (hiver, automne, été) apart from AU printemps.
EN may be used after the verb être or a noun to describe the material of a certain object.
e.g. un rideau en soie
EN is also used in other explessions; the most common and useful are:
parler EN anglais
voyager EN voiture.