They sort of have an on-again and off-again relationship. Dan has always sort of had a crush on her. He finally met her after she came back from boarding school. Serena's life was sort of messy at that time with her family issues and Blair+Nate issues. Dan became the person who sort of took her away from everything. She is the Upper east side's IT girl, and he Brooklyn's lonely boy. They sort of have that fairytale story of rich girl, poor guy, breaking the barriers. They are also step brothers and sisters and I believe they share a sibling. Serena's mom is married to Dan's dad.
Most of the time their relationship problems are the same. Serena has this eternal triangle going on with Nate and Dan. She can't make up her mind between the two. In season 4 she realizes that and apologizes to both of them. Also Dan feels she takes him for granted, she leaves him hanging a lot. They broke up again in season 4, saying next time if they get back together they will be ready. After that Dan started developing a crush on Blair (Serena's best friend) and sort of dating Charlie (Serena's fake cousin)
In season 5, Dan's book he has been writing for past five years will come out, and it might not be a good thing for Serena, and their story might take a whole new turn.