Constitution of Pakistan
Article 91 (3): After the election of the Speaker and the Deputy Speaker, the National Assembly shall, to the exclusion of any other business, proceed to elect without debate one of its Muslim members to be the Prime Minister.
Article 42 (2): A person shall not be qualified for election as President unless he is a Muslim of not less than forty-five years of age and is qualified to be elected as member of the National Assembly.
Hence, A non-Muslim (which includes Ahmediyya Muslim community) cannot constitutionally hold the office of the President of Pakistan and the Prime Minister of Pakistan. However, no such requirement exists over other constitutional offices.