Technically, your buying price is for the lot and the house on it. To calculate if you made a profit (or loss), you’ll have to split the buying price between the lot and the house.
But how? There’s no hard and fast rule, so you have some leeway. Often people just assume a 70/30 split, or a 60/40, or even 50/50. In the middle of San Francisco, the lot might be the 80%; in the middle of Iowa, the house might be 80%.
You need to get some comparison data for the location, and see what a similar house on a smaller lot goes for, or what an empty lot is sold for. You might want to print some examples in PDF and keep them, so you can show the basis of your estimates.
Then do the math. Example: you find another lot - same size, but no house - for 300k. You can now estimate your property to be 300k lot and 700k house, so your sale of half the lot plus the house is a loss of 50k: 800k (what you get) - 700k (house) - 150k (half the lot). You end up with a lot for a base of 150k (important if you ever sell it!) and a tax-relevant 50k loss.
In case you wonder: you’re allowed to pick examples that make the deal look in your favor, but it’s up to you to convince the IRS about validity of your estimates, if they ever audit you.