How rotate a gameobject in Y axis using the mouse position at screen?

Hello @Slaimi ! My guess would be that this is what you want :

using UnityEngine;

public class Rotator : MonoBehaviour
{
    public float Sensitivity;
    private Vector3 objectPositionToScreen;
    private Vector3 mousePosition;

    private void Start()
    {
        objectPositionToScreen = Camera.main.WorldToScreenPoint(transform.position);
    }

    void Update()
    {
        objectPositionToScreen = Camera.main.WorldToScreenPoint(transform.position);

        if (Input.mousePosition.x > objectPositionToScreen.x)
            transform.Rotate(0, Vector3.Magnitude(Input.mousePosition - objectPositionToScreen) * 0.01f * Sensitivity, 0);
        else
            transform.Rotate(0, Vector3.Magnitude(Input.mousePosition - objectPositionToScreen) * 0.01f * (-Sensitivity), 0);
    }
}

This script needs to be attached on the object you want to rotate.
Short explanation : The object will rotate to left if your mouse cursor will be on the left side of the object and it will rotate to right otherwise. You can use the Sensitivity to adjust the rotation speed in accordance to your needs. Have a good day !