(1) By plaintiff; by stipulation. Subject to the provisions of subsection (e) of Code Section 9-11-23, Code Section 9-11-66, and any statute, an action may be dismissed by the plaintiff, without order or permission of court:
(A) By filing a written notice of dismissal at any time before the first witness is sworn; or
(B) By filing a stipulation of dismissal signed by all parties who have appeared in the action.
(2) By order of court. Except as provided in paragraph (1) of this subsection, an action shall not be dismissed upon the plaintiff’s motion except upon order of the court and upon the terms and conditions as the court deems proper. If a counterclaim has been pleaded by a defendant prior to the service upon him or her of the plaintiff’s motion to dismiss, the action shall not be dismissed against the defendant’s objection unless the counterclaim can remain pending for independent adjudication by the court.
(3) Effect. A dismissal under this subsection is without prejudice, except that the filing of a second notice of dismissal operates as an adjudication upon the merits.
(b) Involuntary dismissal; effect thereof. For failure of the plaintiff to prosecute or to comply with this chapter or any order of court, a defendant may move for dismissal of an action or of any claim against him. After the plaintiff, in an action tried by the court without a jury, has completed the presentation of his evidence, the defendant, without waiving his right to offer evidence in the event the motion is not granted, may move for dismissal on the ground that upon the facts and the law the plaintiff has shown no right to relief. The court as trier of the facts may then determine the facts and render judgment against the plaintiff or may decline to render any judgment until the close of all the evidence. The effect of dismissals shall be as follows:
(1) A dismissal for failure of the plaintiff to prosecute does not operate as an adjudication upon the merits; and
(2) Any other dismissal under this subsection and any dismissal not provided for in this Code section, other than a dismissal for lack of jurisdiction or for improper venue or for lack of an indispensable party, does operate as an adjudication upon the merits unless the court in its order for dismissal specifies otherwise.
(c) Dismissal of counterclaim, cross-claim, or third-party claim. This Code section also applies to the dismissal of any counterclaim, cross-claim, or third-party claim.
(d) Cost of previously dismissed action. If a plaintiff who has dismissed an action in any court commences an action based upon or including the same claim against the same defendant, the plaintiff shall first pay the court costs of the action previously dismissed.
(e) Dismissal for want of prosecution; recommencement. Any action in which no written order is taken for a period of five years shall automatically stand dismissed, with costs to be taxed against the party plaintiff. For the purposes of this Code section, an order of continuance will be deemed an order. When an action is dismissed under this subsection, if the plaintiff recommences the action within six months following the dismissal then the renewed action shall stand upon the same footing, as to limitation, with the original action.