DDR differs from DDR2 and DDR3 by the size of the pins on the circuit board the RAM chips are on. As circuit boards are all roughly the same length, their pin size is the first indicator. DDR has 184-pins between both sides, which look larger than the ones on DDR2 & 3, which use 240-pins. Secondly, there's a keyed notch where the pins meet with the pins in the RAM slot. They're keyed differently so you don't accidentally plug them into an incompatible slot. Since DDR2 & 3 both have 240-pins the key's location is different.
usually there's a sticker, failing that expirence tells you, or count how many pins per centimeter and multy pins per cm by legnth of module if number is about 184 it's DDR or remember where the key is