During the early weeks of life a newborn will do what seems like it's smiling but what's really happening is that the newborn baby is just passing gas and not really smiling.
Sometimes the newborn baby could be passing gas while asleep or they're having a dream and smiling as a result of the dream or it could just be a reflex.
If the baby is awake and smiling at you it could mean that they're showing their love for you or they're happy.
At 6 to 8 weeks of life babies can then develop social smiles which can be shown as affection towards the person they're smiling at.