Not confusing. Biblical Text Plain
For his victory he vowed to God to sacrifice who/ what were to come out of his house and greet him (Not the City) He intended to sacrifice a member of his household. It was his daughter whp came out to greet him first. Who in submission to her father said ok, but she wanted to mourn her virginity first as she would never marry. Then she returned and it says Jephtha carried out his vow, Read it for yourself
Judges 11: 29-40 New American Standard Version
29Now (G)the Spirit of the LORD came upon Jephthah, so that he passed through Gilead and Manasseh; then he passed through Mizpah of Gilead, and from Mizpah of Gilead he went on to the sons of Ammon.
30Jephthah made a vow to the LORD and said, "If You will indeed give the sons of Ammon into my hand,
31then it shall be that whatever comes out of the doors of my house to meet me when I return in peace from the sons of Ammon, it shall be the LORD’S, and I will offer it up as a burnt offering."
32So Jephthah crossed over to the sons of Ammon to fight against them; and the LORD gave them into his hand.
33He struck them with a very great slaughter from Aroer to the entrance of (H)Minnith, twenty cities, and as far as Abel-keramim. So the sons of Ammon were subdued before the sons of Israel.
34When Jephthah came to his house at (I)Mizpah, behold, his daughter was coming out to meet him (J)with tambourines and with dancing. Now she was his one and only child; besides her he had no son or daughter.
35When he saw her, he tore his clothes and said, “Alas, my daughter! You have brought me very low, and you are among those who trouble me; for I have given my word to the LORD, and (K)I cannot take it back.”
36So she said to him, “My father, you have given your word to the LORD; (L)do to me as you have said, since the LORD has avenged you of your enemies, the sons of Ammon.”
37She said to her father, “Let this thing be done for me; let me alone two months, that I may go to the mountains and weep because of (M)my virginity, I and my companions.”
38Then he said, “Go.” So he sent her away for two months; and she left with her companions, and wept on the mountains because of her virginity.
39At the end of two months she returned to her father, who did to her according to the vow which he had made; and she had no relations with a man. Thus it became a custom in Israel,
40that the daughters of Israel went yearly to commemorate the daughter of Jephthah the Gileadite four days in the year.