Constrained job to specific queue only in torque

I have two queue, one with 4 node with 24 cpu/node and other 6 node with 48 cpu/node. when I submit my job in queue1 using #PBS -q queue1 and #pbs -l nodes=1:ppn=48 . My job submits and run in queue2, but I want my job to reject as ppn in queue 1 should not exceed 24. I have already edited server_priv/nodes file
what should I add as constraints so job will only run in queue1 and will not pass to queue2. I want job to run on particular queue only when defined #pbs -l queue

node1 np=24 queue1
node2 np=24 queue1
node3 np=24 queue1
node4 np=24 queue1
node5 np=48 queue2
node6 np=48 queue2
node7 np=48 queue2
node8 np=48 queue2
node9 np=48 queue2
node10 np=48 queue2

output of qstat -Qf

Queue: queue1
    queue_type = Execution
    total_jobs = 0
    state_count = Transit:0 Queued:0 Held:0 Waiting:0 Running:0 Exiting:0 Comp
	lete:0 
    resources_max.ncpus = 96
    resources_default.walltime = 240:00:00
    mtime = 1628841336
    resources_assigned.nodect = 0
    enabled = True
    started = True

Queue: queue2
    queue_type = Execution
    total_jobs = 0
    state_count = Transit:0 Queued:0 Held:0 Waiting:0 Running:1 Exiting:0 Comp
	lete:0 
    resources_max.ncpus = 288
    resources_default.walltime = 240:00:00
    mtime = 1628841336
    resources_assigned.nodect = 0
    enabled = True
    started = True

output of pbsnodes -a of one node

node-10
     state = free
     power_state = Running
     np = 48
     properties = queue2
     ntype = cluster
     status = opsys=linux,uname=Linux node-10 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64,sessions=21618 21628 21760 21998,nsessions=4,nusers=2,idletime=122868,totmem=263585848kb,availmem=256147964kb,physmem=196476988kb,ncpus=96,loadave=0.00,gres=,netload=28359027509,state=free,varattr= ,cpuclock=Conservative:1200MHz,macaddr=ac:1f:6b:4e:2f:e2,version=6.1.0,rectime=1628868602,jobs=
     mom_service_port = 15002
     mom_manager_port = 15003

Please note @prnvrvs you are posting the query in the discussion forum for openpbs which is different workload management system than the one you are using. Please check this link: https://openpbs.org/
You can achieve this in openpbs in many ways

Thanks @adarsh , yes I know its different but many methodologies are same. Anyway Here is my follow up question, If I want to upgrade from torque to open-pbs. Do I need to start from scratch.Do I need to change my current OS(centos-7.6.1810)

Thank you @prnvrvs

The protocol would be
0. we cannot upgrade torque to openpbs, it would have to be un-install, clean install from scratch

  1. un-install your existing work load manager
  2. Download or complile openpbs from source
  3. If you had CentOS 8.x , then the compiled installer/binaries are readiily available to download form this link https://openpbs.org/Download.aspx#download

Normally you would no longer use “ppn” in PBSPro but use things like -lselect=2:ncpus=24 – and in that case you can set limits on the queue (resources_max.ncpus=xxx) and even resource utilisation limits (resources_available.ncpus=YYY).

Queuejob hooks can be used to convert submission syntax into something different from the default conversions that will be applied.