Help With Camera rotation on X and Y Axis (Target Focused)

Hey so im trying to develop a camera that works similar to PotBS (Pirates of the Burning Sea) or ETS/ATS (Truck Simulators). So far I have it so the camera can zoom in and out and rotate around the object no problem. I am having trouble however when I add another axis. I tried adding a separate game object within the object im looking at so that I could assign the two separate axis to look at a different object but not sure if it helped.

So when I move the mouse left or right, its works great and I can rotate around no probs, but the Y axis is bugging out! I would alos like to implement so limits as to how ‘High’ the camera can go and also stop it from going below. Heres what I have so far

using UnityEngine;
using System.Collections;

public class PlayerCamera : MonoBehaviour {

	public Transform target = null;
	public Transform target2 = null;
	int degrees = 10;

	private Vector3 tempPos;
	private Vector3 tempRot;

	// Zoom settings
	private float minFov = 15f;
	private float maxFov = 90f;
	private float sensitivity = 30f;

	// Use this for initialization
	void Start () 
	{
		
	}
	
	// Update is called once per frame
	void LateUpdate ()
	{
		if (target != null) {
			transform.LookAt (target.transform);
		}
			
		if (Input.GetMouseButton (2)) {

			transform.RotateAround (target.position, Vector3.up, Input.GetAxis ("Mouse X") * degrees);
			transform.RotateAround (target2.position, -Vector3.right, Input.GetAxis ("Mouse Y") * degrees);

			tempPos = transform.position;
			tempRot = transform.rotation.eulerAngles;

			transform.eulerAngles = new Vector3 (tempRot.x, tempRot.y, tempRot.z);
			transform.LookAt (target.transform);

			if (tempPos.y < 3) {

				tempPos.y = 3;
			}
			transform.position = tempPos;
			transform.LookAt (target.transform);
		}

		float fov = Camera.main.fieldOfView;
		fov -= Input.GetAxis("Mouse ScrollWheel") * sensitivity;
		fov = Mathf.Clamp(fov, minFov, maxFov);
		Camera.main.fieldOfView = fov;
	}
}

Why the target is Null ?? In line 25

void LateUpdate ()
     {
         if (target != null) {
             transform.LookAt (target.transform);
         }