Syed and Sharif are historical terms that have been used in different ways through different times and by different people. I know of two variations (but I know there are others):
The first one (and probably the most used):
- Syed: Descendant of Hassan ibn Ali ibn Abi Talib.
- Sharif: Descendant of Hussain ibn Ali ibn Abi Talib.
The second one:
- Syed: Descendant of the prophet's grandsons (Hassan and Hussain).
- Sharif: Descendant of the prophet's greater family (Banu Ali, Banu Abbas, Banu Hashim ... etc).
Related Wikipedia articles that cover some of these definitions: