To solve this optimization problem, we first need to define the variables and constraints based on the given information.

Let's denote:
- \(M\) as the number of marble countertops produced.
- \(G\) as the number of granite countertops produced.

The objective is to maximize profit. The profit per marble countertop is $500, and the profit per granite countertop is $750. Therefore, the total profit \(P\) can be represented as:
\[ P = 500M + 750G \]

Now, let's consider the constraints:

1. **Cutting Time Constraint**: It takes 1 hour of cutting to make one marble countertop and 1.5 hours to make one granite countertop. The company has available 300 hours for cutting. Therefore:
\[ M + 1.5G \leq 300 \]

2. **Polishing Time Constraint**: It takes 2 hours of polishing to make one marble countertop and 3 hours to make one granite countertop. The company has available 500 hours for polishing. Therefore:
\[ 2M + 3G \leq 500 \]

3. **Non-Negativity Constraints**: The number of countertops produced cannot be negative.
\[ M \geq 0 \]
\[ G \geq 0 \]

Given these constraints and the objective function, we can now write the Gurobi code in Python to solve this linear programming problem.

```python
from gurobipy import *

# Create a model
m = Model("Countertop_Production")

# Define variables
M = m.addVar(vtype=GRB.CONTINUOUS, name="Marble_Countertops")
G = m.addVar(vtype=GRB.CONTINUOUS, name="Granite_Countertops")

# Set the objective function: Maximize profit
m.setObjective(500*M + 750*G, GRB.MAXIMIZE)

# Add constraints
m.addConstr(M + 1.5*G <= 300, "Cutting_Time_Constraint")
m.addConstr(2*M + 3*G <= 500, "Polishing_Time_Constraint")

# Optimize the model
m.optimize()

# Print results
if m.status == GRB.OPTIMAL:
    print("Optimal solution found.")
    print(f"Marble Countertops: {M.x}")
    print(f"Granite Countertops: {G.x}")
    print(f"Maximum Profit: ${500*M.x + 750*G.x:.2f}")
else:
    print("No optimal solution found.")

```