[If] he says to her, "Behold you are permitted to any man except for so-and-so," or "beside so-and-so", it is not a get [bill of divorce]. What should he do? He should take it from her, and give it to her again and say, "Behold you are permitted to any man." But if he says, "On condition..." ["al menat"] that is like any condition on a get [which is fine], whether he says, "On condition you do not marry him," or "on condition you not not become his spouse," or "on condition you do not become his." Rem"a: Some are stringent even when he says "al menat" (Ran in the name of Y"A, Rashba in the name of the Ramban_, and some are stringent [only] in an ideal case. And if she is suspected of cheating with a certain man, he should tell Bet Din and they will prevent them from marrying each other (Mordechai beginning of Hamegaresh).
If the man excluded from divorce using the terminology "chutz" or "ela" (meaning except for) was someone with whom betrothal would not be valid for her (e.g. a forbidden relative) then the bill of divorce is kosher. But if betrothal with him would be valid for her, even if doing so would violate a negative commandment, then the get is not valid. The same applies if the get excludes a minor (that the get is invalid). There is an authority who says that if the get excludes a minor she is doubtfully divorced (Tur in the name of Rabbenu Tam).
If the man excluded is (i.e. she is permitted to everyone except) the husband of her sister, or he excluded someone who is not yet born, or he said to her, "except for extramarital relations,"... Rama: or except for anal intercourse (Tur) Mechaber: ...or to the exclusion of [remarriage with] a kiddushin document (as opposed to money) or [remarriage with] money (as opposed to a kiddushin document) or to the exclusion of the abrogation of your vows or to the exclusion of your inheritance, she is doubtfully divorced.
If he wrote (lit. said to her), "You are hereby permitted to every man except for Reuven and Shimon," and then at the time he delivered the get he said, "You are hereby permitted to Reuven and Shimon," or he said, "You are hereby permitted to Reuven," or he said, "You are hereby permitted to Shimon," or he said "Even to Shimon;" she is doubtfully divorced.
If he said to her, "Here is your get and you are hereby divorced from me today, but tomorrow you will be my wife," she is doubtfully divorced.