To formulate a linear programming (LP) model that maximizes profit for the electronics store, we first need to define our decision variables, objective function, and constraints based on the given problem description.

Let's denote:
- \(M\) as the number of monitors to keep in stock.
- \(G\) as the number of gaming stations to keep in stock.

The objective is to maximize profit. Given that the profit per monitor sold is $40 and the profit per gaming station sold is $80, our objective function can be written as:
\[ \text{Maximize:} \quad 40M + 80G \]

Now, let's consider the constraints:

1. **Floor Space Constraint**: Each monitor requires 8 sq ft of floor space, and each gaming station requires 12 sq ft. The total available floor space is 150 sq ft.
\[ 8M + 12G \leq 150 \]

2. **Marketing Requirement Constraint**: At least 40% of all items in stock must be gaming stations. This can be expressed as:
\[ G \geq 0.4(M + G) \]
Simplifying, we get:
\[ G \geq 0.4M + 0.4G \]
\[ 0.6G \geq 0.4M \]
\[ G \geq \frac{2}{3}M \]

3. **Capital Constraint**: Each monitor ties up $180 in capital, and each gaming station ties up $260. The maximum capital to be tied up is $4,000.
\[ 180M + 260G \leq 4000 \]

4. **Non-Negativity Constraints**: Both \(M\) and \(G\) must be non-negative since they represent quantities of items.
\[ M \geq 0 \]
\[ G \geq 0 \]

Now, let's translate this LP formulation into Gurobi code in Python:

```python
from gurobipy import *

# Create a new model
model = Model("Electronics_Store_Profit_Maximization")

# Define the decision variables
M = model.addVar(vtype=GRB.INTEGER, name="Monitors")
G = model.addVar(vtype=GRB.INTEGER, name="Gaming_Stations")

# Set the objective function
model.setObjective(40*M + 80*G, GRB.MAXIMIZE)

# Add constraints
model.addConstr(8*M + 12*G <= 150, "Floor_Space_Constraint")
model.addConstr(G >= (2/3)*M, "Marketing_Requirement_Constraint")
model.addConstr(180*M + 260*G <= 4000, "Capital_Constraint")

# Optimize the model
model.optimize()

# Print the results
if model.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Monitors to stock: {M.x}")
    print(f"Gaming Stations to stock: {G.x}")
    print(f"Maximum Profit: ${model.objVal:.2f}")
else:
    print("No optimal solution found")
```