You can add the static form code to your main site’s code (your domain in this case is example.com and your subdomain is sub.example.com):
<form name="loginform" id="loginform" action="https://sub.example.com/wp-login.php" method="post">
<p>
<label for="user_login">Username or Email Address</label>
<input type="text" name="log" id="user_login" class="input" value="" size="20" autocapitalize="off">
</p>
<div class="user-pass-wrap">
<label for="user_pass">Password</label>
<div class="wp-pwd">
<input type="password" name="pwd" id="user_pass" class="input password-input" value="" size="20">
<button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="Show password">
<span class="dashicons dashicons-visibility" aria-hidden="true"></span>
</button>
</div>
</div>
<p class="forgetmenot"><input name="rememberme" type="checkbox" id="rememberme" value="forever"> <label for="rememberme">Remember Me</label></p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="Log In">
<input type="hidden" name="redirect_to" value="https://sub.example.com/wp-admin/">
<input type="hidden" name="testcookie" value="1">
</p>
</form>
The hidden redirect_to input field tells WP where it will redirect upon successful login (wp-admin/ will have you end up in the dashboard).
The form however will not look like it does in WordPress due to the missing style. You can either add the WP login.css
to your main site’s code
<link rel="stylesheet" id="login-css" href="https://sub.example.com/wp-admin/css/login.css?ver=5.3.2" type="text/css" media="all">
or just style it the way you like.