The Rambam, in the introduction to his Sefer Hamitzvot, gives 14 criteria by which he arrives at a count of 613 mitzvot. Here is a summary of them, one by one.
1. Don't count mitzvot derabanan.
2. Don't count mitzvot derivable from the "13 exegetical methods" (Even if they are deoraita, they are "anafim" not "shorashim".) Mitzvot are not counted unless they are explicit in the Torah's pshat, or else explicitly mentioned as oral tradition from Sinai.
3. Don't count mitzvot which are not "ledorot".
4. Don't count mitzvot which encompass the entire torah (i.e. "kedoshim tihyu").
5. The reason for a mitzvah is not a separate mitzvah (i.e. arayot followed by "lo tachti et haaretz").
6. A mitzvah with positive and negative components - they are counted separately.
7. All the details of a mitzvah, despite appearing in different verses, count as one overall mitzvah.
8. A statement that a mitzvah does not apply in some circumstance is not a separate, negative mitzvah.
9. Mitzvot which are repeated count only once. "Do not do X or Y" - X and Y together are 1 mitzvah.
10. Specified preparatory activities to a mitzvah (i.e. "kach lecha samim") are not separate mitzvot.
11. Different mitzvah activities with a single "purpose" (i.e. blue/white tzizit or lulav/etrog) are not separate mitzvot.
12. A general command (i.e. "ve'asu li mikdash", "torah haolah") is one mitzvah, though it is followed by many commands regarding the details. (However details which apply to more than one mitzvah, such as "al kol korbanecha takriv melach", are separate mitzvot.)
13. A mitzvah which applies unchanged on multiple days is one mitzvah (i.e. musaf).
14. Each type of judicial punishment is one mitzvah, though it's used for many different crimes.