You can use admin_init
to get this done. This hook fires when an admin page is starting to load and you can use it to redirect the user to a different page. Like this:
add_action('admin_init','wpse362882_redirect_login_page');
function wpse362882_redirect_login_page () {
global $pagenow;
if ( ($pagenow == 'wp-login.php') && is_user_logged_in() ) {
.. do some stuff to determine $url to redirect user based on role ..
wp_redirect($url);
exit;
}
}