David lived in Philistine territory a year and four months.
References for 1 Samuel 27:7
Now David and his men went up and raided the Geshurites, the Girzites and the Amalekites. (From ancient times these peoples had lived in the land extending to Shur and Egypt.)
References for 1 Samuel 27:8
Whenever David attacked an area, he did not leave a man or woman alive, but took sheep and cattle, donkeys and camels, and clothes. Then he returned to Achish.
References for 1 Samuel 27:9
When Achish asked, “Where did you go raiding today?” David would say, “Against the Negev of Judah” or “Against the Negev of Jerahmeel” or “Against the Negev of the Kenites.”
References for 1 Samuel 27:10
He did not leave a man or woman alive to be brought to Gath, for he thought, “They might inform on us and say, ‘This is what David did.’ ” And such was his practice as long as he lived in Philistine territory.
Achish trusted David and said to himself, “He has become so obnoxious to his people, the Israelites, that he will be my servant for life.”
References for 1 Samuel 27:12