Answer explained
How is the Prime Minister appointed ?
The President appoints the leader of the party or coalition with a majority in the Lok Sabha as Prime Minister. If no party has a clear majority, the President appoints the leader most likely to prove majority on the floor of the House.