جَاءَ أَحْمَدُكُمْ — Aḥmad is the nominative subject: ḍammah.
رَأَيْتُ أَحْمَدَكُمْ — Aḥmad is the accusative object: fatḥah.
مَرَرْتُ بِأَحْمَدِكُمْ — Aḥmad is genitive after bi-, and the iḍāfah allows kasrah. The al-/iḍāfah rule does not replace nominative and accusative case endings.