
According to Rule 21 of the Massachusetts Rules of Criminal Procedure:
Upon his own motion or the motion of either party, the judge may, prior to or during the examination of a witness, order any witness or witnesses other than the defendant to be excluded from the courtroom.
This is known as “sequestering the witnesses.”
Lawyers who seek witness sequestration are usually trying to prevent witnesses from being influenced by each other’s testimony.
As one text puts it
The process of sequestration consists merely in preventing one prospective witness from being taught by hearing another’s testimony.
Wigmore on Evidence, Sec. 1838 at 461.
A motion to sequester witnesses can be filed at the trial readiness conference or on the day of trial. Additionally, a lawyer seeking witness sequestration can often simply move for such an order (orally) at the start of trial.
It’s within the judge’s discretion to allow or deny the sequestration request. If a witness violates a sequestration order, his or her testimony may be barred from evidence.