Do babies know people? Can they sense emotion?

Tilley
My best friend has a 4 month old son. Today she and I went to her baby's father's house. When he held his son, the baby was screaming, crying and he kept cussing and screaming at my friend so he handed the baby back to me and he stopped crying. After we left, I sat beside Blake (the baby) at a restaurant and he kept looking at me and smiling, cooing at me! If I didn't look at him for too long, he'd scream really loud till I looked at him, then giggle when I did look. Does he know I love him and his dad was mad? Or does he recognize me? I've watched him a few times by myself so my friend can work and I'm always around him. The baby's dad sees him every other weekend and doesn't take care of him. Thoughts?