As NotPoliticallyCorrect mentioned, if the form is open, the button should be disabled.
But to answer your question, the following code does what you ask:
private void ButtonClick(object sender, EventArgs e)
{
Form form = null;
if (sender == button1)
{
if (Application.OpenForms[nameof(Form1)] == null)
form = new Form1();
}
else
{
if (Application.OpenForms[nameof(Form2)] == null)
form = new Form2();
}
if (form != null)
{
form.Owner = this;
form.Show();
}
}