1 David went to Nob, to Ahimelek the priest. Ahimelek trembled when he met him, and asked, “Why are you alone? Why is no one with you?”
2 David answered Ahimelek the priest, “The king sent me on a mission and said to me, ‘No one is to know anything about the mission I am sending you on.’ As for my men, I have told them to meet me at a certain place.
3 Now then, what do you have on hand? Give me five loaves of bread, or whatever you can find.” – 1 Samuel 21:1-3
King David, one of the greatest Prophet’s, who was the ancestor of Jesus, he was said to have deceived Ahimelch the Priest. The purpose was to safeguard the priest from knowing if he knew what David did – if the king found out, Ahimelech would have been slaughtered. Although David had good intentions to protect himself, he used deception to achieve this. Hence, this is another verse amongst many more where the Bible permits one to lie in those circumstances.
Bridgeway Bible Commentary
Flight from Saul (21:1-15)
The first place to which David fled was Nob, which, since the destruction of Shiloh, had become the city of priests (21:1). About this time a few personal servants joined him, according to an arrangement he had made with them earlier. David obtained food for himself and his men by deceiving Ahimelech the priest concerning the purpose of his journey. Unfortunately for him, and for Ahimelech and the other priests, he was seen by someone sympathetic to Saul (2-9). 
L. M. Grant’s Commentary on the Bible
David came down to Nob, which was a cause of alarm to Ahimelech the priest, who asks why he had no man with him. It would seem from the history here that he had no-one identified with him, yet there must have been others in the vicinity who where with him, because the Lord Jesus, in commenting on this occasion, definitely speaks of “those that were with him (David)” (Matthew 12:3). As he told Ahimelech, he evidently appointed his servants to a place in the area.
Still, his words were not true that the king had sent him on some secret mission. He did not want Ahimelech to know of Saul’s determination to kill him, for this might make him fear to show any evident kindness to David. Ahimelech was easily deceived by his words, however, and was persuaded to give David the used bread of the sanctuary. He did want to make sure that the men were ceremonially clean, and he took David’s word for this (v.45). 
Peter Pett’s Commentary on the Bible
David’s reply was that he was on a secret mission about which he had been commanded not to talk, and that his young men were waiting for him elsewhere. There was no reason why Ahimelech should have doubted the truth of his words. In fact it is doubtful if there were any young men waiting, (none are mentioned elsewhere), and what is certain is that he was not on a mission for Saul. So the whole thing was probably a fabrication. 
The Pulpit Commentary
The king hath commanded me a business. This pretence of a private commission from the king was a mere invention, but his “appointing his servants to meet him at such and such a place” was probably the exact truth. After parting with Jonathan, David probably did not venture to show himself at home, but, while Saul still supposed him to be at Bethlehem, gave orders to some trusty officer to gather together a few of his most faithful men, and await him with them at some fit place.
Meanwhile alone he sets out on his flight, and, having as yet no settled plan, goes to Nob, because it was out of the way of the road to Bethlehem, whither Saul would send to arrest him. Naturally such a visit would seem strange to Ahimelech; but David needed food and arms, and probably counsel; and. but for the chance of the presence of Doeg, no harm might have ensued. As it was, this visit of David completed the ruin of Eli’s house.